New answers tagged

0

The Solution would seem to be, to install pyton-dev or a similar package: http://stackoverflow.com/questions/21530577/fatal-error-python-h-no-such-file-or-directory


0

There is a great collection of syntax highlight themes on Github. Please check: https://github.com/codebrainz/geany-themes Just follow the Unix-like Installation section: Extract the tarball and copy all of the files in the colorschemes directory to your ~/.config/geany/colorschemes/ directory. Create that directory if it doesn't already exist.


0

Indeed, you may notice that some indicators (like volume or keyboard language ones) support middle mouse click. It can be done with set_secondary_activate_target(menu_item). My code snippet for pyGtk/pyGI: menu_items = Gtk.MenuItem("Toggle Floater") menu.append(menu_items) menu_items.connect("activate", self.toggleWindow) ...


0

Try this: dconf reset -f /org/compiz/ then setsid unity It worked for me. Refer this link for more details.


0

Please add this ppa https://launchpad.net/~fkrull/+archive/ubuntu/deadsnakes This one has the latest 3.5 version


1

A python script should start with a python shebang. Remove the REPL output: Python 2.7.10 (default, Oct 14 2015, 16:09:02) [GCC 5.2.1 20151010] on linux2 Type "copyright", "credits" or "license()" for more information. >>> And change the first line to either #!/usr/bin/env python or (assuming your python is in /usr/bin) #!/usr/bin/python


1

Just so that another unfortunate soul doesn't go on the same wild goose chase, as noted by a comment here, as of Feb 2015 you can now do sudo apt-get install python3-pyqt5 Worked like a charm for my script in pycharm


2

Put this line in your .bashrc assuming you're using bash as shell: export PATH=/path/to/your/script/:"$PATH" You can use vi, nano or gedit to edit this line in the end of the file. Make sure your script is set to executable mode, if it's a bash script: chmod +x script.sh Or if it's a Python script: chmod +x script.py On your script indicate their ...


2

Perhaps the easiest way to do this is to place your script in $HOME/bin and making sure that the permissions are set to executable: chmod +x $HOME/bin/script.py Now you should be able to run the script from any directory.... A couple of other points to be aware of: Ensure that $HOME/bin is in your $PATH, for Ubuntu this will be set by default in ...


-1

To install or update python just type this in Terminal: sudo apt-get install python That's it :)


0

There are some instructions on doing this here. It suggests compiling python 2.7.11 from the source and creating a virtual environment in which to use it.


0

You can use nested dictionary like this: self._properties = dbus.Dictionary({ 'Metadata': dbus.Dictionary({ 'mpris:length': dbus.Int64(2400000000), 'mpris:artUrl': 'file:///home/user/1.jpg', 'xesam:artist': ['1', '2'], 'xesam:title': 'hello world', 'xesam:url': '', ...


0

Programs started from the Ubuntu launcher do not read .bashrc. As an alternative to setting the paths in PyCharm, you can simply start PyCharm from a Bash shell to give it access to the environment variables you set in .bashrc.


-1

[http://kuboosoft.blogspot.com.es/2014/10/solucion-al-problema-de-uso-de-titulos.html][1] Solución al problema de uso de titulos animados con Openshot y Blender Si usted esta aburrido, o cansado que no puede utilizar todos los títulos animados de Openshot por un problema con Blender, la solución es mas fácil de lo que parece. Fedora, openSuse, Arch ...


1

From your question, it is not fully clear if you need to be inside the directory of CMDexecutable (and thus cd first) or if the full path would do, but the only option I see is to add the script to the sudoers file, as described here. Then you can run the script with sudo, without having to enter the password. You can simply run the (python) script then by ...


5

I think you have a basic misconception: talking of a shell that you cannot run interactively but that you can run non-interactively is much like talking of a car that you can't drive but that you can use to listen to the radio. The main purpose of a shell is running interactively, the fact that it can run non-interactively is the optional, not the other way ...


2

Loop through file splitting each line into fields and check if 6th field doesn't contain "no-login" for all the lines where UID is greater than 1000 >>> with open("/etc/passwd") as file: ... for line in file: ... if int(line.split(":")[2]) > 1000 and not str(line.split(":")[6]).__contains__("nologin"): ... print line ... ...


1

The following youtube link helped me in installing https://www.youtube.com/watch?v=jpdFwfGFlq8 The steps are shown below: sudo apt-get install libssl-dev openssl wget https://www.python.org/ftp/Python/3.5.0/Python-3.5.0.tgz tar xzvf Python-3.5.0.tgz cd Python-3.5.0.tgz ./configure sudo make sudo make install check if python is installed type python3.5 ...


9

Don't remove python 2!! Ubuntu versions, later then 12.04 already have python 3 installed. This is an additional version, not instead of. A lot of software (still) depends however on 2.7, removing it will break the system. On Ubuntu, python 2 is called by: python or python2 while python 3 is called by python3 See the current version(s) If you ...


0

Install the latest gcalcli from pip (the linux repo is outdated). pip install --upgrade gcalcli Then run the gcalcli with a command on terminal, like this- gcalcli list This will open a web browser page to authenticate gcalcli with google. Try this for usage information; gcalcli help


1

You can either upgrade pip globally using sudo: sudo pip3 install --upgrade pip sudo pip2 install --upgrade pip Or you can upgrade it for your user only using the --user option: pip3 install --upgrade --user pip pip2 install --upgrade --user pip Note that I upgrade both pips for Python 2 and Python 3. It's important to upgrade the version for Python 3 ...


0

The way I personally approach this would be for loop with find command, supplying the directories where drives are mounted for DRIVE in "/media/username/Drive1" "/media/username/Drive2" "/mnt"; do find "$DRIVE" -type f -name "myFile.txt" done Simpler way would be just supply the directories without for loop find "/media/username/Drive1" ...


0

Please try running your command using sudo, like this: sudo conda install opencv


2

The problem was that somehow "anaconda2" folder where "anaconda" is installed, was set to 'access only' because the owner of "anaconda2" folder was "root". Now I have changed the ownership of "anaconda2" folder by using command sudo chown -R ws2 anaconda sudo chown -R usr foldername


0

Pretty nice walk-through..... https://help.ubuntu.com/community/PostgreSQL First find the file pg_hba.config. Usually found here: /etc/postgresql/9.3/main/pg_hba.conf OR /etc/postgresql/[VERSION]/main/pg_hba.conf Find this commented-out line: # Database administrative login by Unix domain socket And Underneath Change '???' to md5: local all ...


0

After much trial and error I've found the problem. It's the pip that's in Ubuntu PPA, v1.5.6. Of course it's ultimately my user error, but that version of pip is really not forgiving. I wrote more about it on this post.


0

For the archives, after much trial and error this is what I've found (in retrospect, some bits make sense, others quite confusing). If you sudo apt-get install python-xyz, the package will appear in pip list. Of course you can import it in python, but it doesn't appear in pip.get_installed_distributions(). (Obviously the opposite is not true. i.e. if you ...


1

An other solution with netcat : echo -n "test message" | nc -4u -w1 <host> <udp port>


0

The answer appears to be to add a third party repository: sudo add-apt-repository fkrull/deadsnakes-python2.7 sudo apt-get update sudo apt-get install python2.7 python --version


0

On that page they're suggesting to add this to ~/.bashrc: export PATH="$HOME/.pyenv/bin:$PATH" eval "$(pyenv init -)" eval "$(pyenv virtualenv-init -)" I suppose you did that and now one of the two commands (eval "$(pyenv init -)" or eval "$(pyenv virtualenv-init -)") is spawning a subshell which isn't either exiting nor outputting anything. Remove eval ...


0

You could be just 4 terminal commands away from an easy installation, depending on the state of your system. First, there is always risk breaking from the herd. My 15.10 system only has python-matplotlib 1.4.1something or other. You could download the source Once you have satisfied the requirements detailed in the INSTALL file (mainly python, numpy, ...


0

If you need tkinter only for matplotlib, you can also use a different backend, like Egg: import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt See more details here


0

If you have edited yr user's crontab, then suppress/erase the user name cyberbemon that precedes the long path leading to yr script. You do not need the user's name in there. If I am not mistaken you specify the user's environment with #! at the beginning, no just !. It may just be a typo in post or you forgot to escape the pound sign inside the code block, ...


0

pip install basemap Or, if you're using Anaconda: conda install basemap


1

I've repackaged the given answers in this thread into a standalone example: #!/usr/bin/env python2 import signal from gi.repository import Gtk def bind_accelerator(accelerators, widget, accelerator, signal='clicked'): key, mod = Gtk.accelerator_parse(accelerator) widget.add_accelerator(signal, accelerators, key, mod, Gtk.AccelFlags.VISIBLE) def ...


0

To locate the file use: $ locate ikfast_generator_cpp.py Then when you find the path it is in, copy the path and use the following command below. Lets say the path to your file is openrave-0.9.0-src/python/ikfast_generator_cpp.py. To run an executable .py (Python) file, use the command: $ ./openrave-0.9.0-src/python/ikfast_generator_cpp.py or if it ...


0

For Python3.5 use the command alias python=python3.5 and for Python2.7 use alias python=python2.7


0

cat > /usr/local/bin/py #!/usr/bin/dash python3 "$@" <CTRL-D> (provided you have write permission to /usr/local/bin) likewise cat > /usr/local/bin/pyi #!/usr/bin/dash python3 -i "$@" <CTRL-D> then you only type py (and use py in #! lines) for your chosen python.


0

I think it works as it is supposed to. I believe you have problems with the routing table. When you connect the first adapter the default routing is set up through this adapter. When you connect another one, the default routing is already setup for the first adapter. The second adapter does not work because there is no routing that would use it. Try to type ...


1

From the Ubuntu Package Index, the default version of: Python 2 is 2.7.9 for both 15.04 and 15.10. Python 3 is 3.4.3 for both 15.04 and 15.10.


1

I would take a look at python virtual environments. This question has a guide for installing virtualenv (or another link to another guide). Virtualenv can be used to set up isolated python environments that do not do anything to the system python. Here is a guide on how to use python virtual environments. They are extremely useful for projects that ...



Top 50 recent answers are included