New answers tagged

0

I believe gedit functions via plugins to highlight and console for different languages. From a quick google search, I found a gedit bug with this comment: 'in /usr/lib/gedit/plugin choice your plugin for example gemini.plugin Change [Plugin] Loader = python by [Plugin] Loader = python3 In some plugins it worked for me'


1

Execute man apt-get and go down (/) to the install function. This is worth reading. By the way, did you try the following? sudo apt-get install gunicorn=19.3.0 (one equal sign, not two) As the man page states, use this feature with care. I don't know why you'd want an older version of a package on your installation but I'd guess that it would ...


0

To set up the cronjob for the user you have logged in for follow this steps log into the ssh console Open the crontab file by typing crontab -e close the file with changes you want to make. In your case the syntax is right. Once you close the file you can see that 'new crontab is installing' message you are done.


0

The first procedure you followed is correct sudo apt-get -y install python3-pip But before installing try to update using command sudo apt-get update If first did not work then you can also do this using curl curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py" python get-pip.py Then to verify installation try pip --help


0

In shell terminal $ which -a python lists all your python. $ which -a python2.7 lists all your python2.7. $ /usr/bin/python -V gives information about the version of /usr/bin/python. check in python script here is an ilustration in ipython shell: In [1]: import sys In [2]: sys.version 2.7.11 |Anaconda 2.5.0 (64-bit)| (default, Dec 6 2015, 18:08:32) ...


2

Update to the latest version from our website. Bug fixed in 3.2.0.


0

I have been having similar issues in the past couple days, so I traced it back to how bash handles "command not found". In Ubuntu 14.04 (and Linux Mint 17, which I uses the 14.04 scripts), /etc/bash.bashrc has the following function: if [ -x /usr/lib/command-not-found ]; then function command_not_found_handle { # check because c-n-f could've ...


0

The easiest way to install Ipython is with Anaconda.


5

you could use find and shuf: #!/bin/bash SOURCE="path/to/source" DESTINATION="path/to/destination" COUNT=25 rm -r "${DESTINATION}/"* find "$SOURCE" -mindepth 2 -maxdepth 2 -type d|shuf -n $COUNT|xargs -d'\n' -I{} cp -r "{}" "$DESTINATION"


2

This is an easy way to install all non-Python dependencies before doing a pip installation: Install dependencies of the system version – this does not install the system version itself. sudo apt-get build-dep python-matplotlib Enter your virtualenv as usual (you may use a different tool to do this): pew workon your_virtualenv Install matplotlib (and ...


8

The script below should do the job: #!/usr/bin/env python3 import random import os import subprocess import shutil # set the desired number of folders to pick below n_selection = 5 # set the name of the flash drive below flashdr = "Lexar" # set the source directory (with media folders) below sourcedr = "/path/to/mediafiles" # --- try: targetdr = ...


1

I made a script with Python: The script, at GitHub Gist. (Download) Usage: python3 RandomCopier.py [source folder] [destination folder] [number to copy] The copy method: NOTE: It will not copy any files directly in the source folder, only those in sub-folders of it. Say, the source folder, src is: src |- a | |- file_a | |- file_a_2 | |- b | |- ...


1

First, make sure myscript.py is executable by doing chmod +x myscript.py. Second, ensure that the shebang #!/usr/bin/env python appears as the first line of myscript.py. You then execute the script using ./myscript.py [arguments].


0

Edit your script so your first line is a shebang pointing to the desired interpreter's executable path. First, find where the python executable is, with which python. Then, in your script's first line, add #!/path/to/python Then run mkdir $HOME/bin And put your script there. That should do it!


1

Add #!/usr/bin/python to the first line of your script. This presumes that you have python installed and runnable from /usr/bin, and that the current directory (.) is in your PATH environment variable (not the default,but you can change it in your home .profile file).


1

I finally managed to solve the problem! Remove current installation of pybfd by pip uninstall pybfd. Clone my fork of pybfd which fixes the issue on 16.04 onwards. (created a pull request though) Install the package by sudo python setup.py install.


0

Here's what I do to get python support in vim apt-get install -y python-software-properties software-properties-common add-apt-repository ppa:pi-rho/dev # add this repo so that vim has python 4? compiled in to support plugins like gundo add-apt-repository -y ppa:pi-rho/dev apt-get update install vim-gtk this install a massive vim build that will give ...


1

Those packages have +python3 support. If you want Python 2 support (+python), install the py2 packages (vim-nox-py2, vim-gnome-py2, etc.).


1

Type the command in the terminal: sudo apt-get install python-gobject


1

try - import apt_pkg apt_pkg.init() arch_location = apt_pkg.config.find_file('Dir::cache::archives') http://apt.alioth.debian.org/python-apt-doc/library/index.html


0

Open a terminal window ands type: sudo add-apt-repository ppa:nathan-renniewaldock/flux Press Enter, then type: sudo apt-get update Press Enter, then type: sudo apt-get install fluxgui Press Enter. That's all. And you got updates for it too. It seems to me that you didn't got f.lux, but xflux. They are two different projects.


0

cd xflux-gui && cp xflux xflux64 The previous answer is the wrong way round as there is no flux64 file to copy.


1

For me, Tim's code didn't quite work. I had to do this: import alsaaudio m = alsaaudio.Mixer(alsaaudio.mixers[0]) # alsaaudio.mixers = ["PCM"] for me. m.setvolume(90) # Or whatever It may be due to my weird / broken .asoundrc config file. But given that there is no actual reference documentation for .asoundrc - just some random examples - I don't think ...


0

The best thing in these cases is just to print the string before using it so you can see if everything is correct. command = "sudo insmod /home/hajer/final_module/module.ko src_ip=" +(R1.get())+ "delay=" +(R2.get())+ "tcp_port=" +(R3.get()) print(command) os.system(command) My guess is you're missing a space before the delay and tcp_port parameters. ...


0

You can add the Wily repositories to your sources.list and use Apt preferences as described here. That question is about upgrading a package, but the exact same idea applies for downgrades. However you will need to initially install the Wily version manually (or give it a priority over 1000) to force the downgrade. After the downgrade is done, a priority of ...


3

I've been looking for something similar, since I'm trying to de-dupe a large music archive, would like to keep the highest quality files, but don't trust the bitrates used. I've found fakeflac which seems like a good start. Don't let the name fool you, it's not FLAC-specific since it converts the given file to wav and operates on that using a Python script. ...


0

If someone will ever encounter with this problem or similar one, I've found the solution. One of the steps doesn't have the necessary package. I manually install this package and my problem was solved. sdl2_ttf


0

You can add a program or script to the /etc/rc.local file. This script is run at boot time. All the lines in the script are run as root. If you have a program named /usr/local/bin/myprogram and added this line to the rc.local script it would be run as root. /etc/rc.local: # By default this script does nothing /usr/local/bin/myprogram


0

In what must be my 6th distinct attempt in as many months to setup and run GNU Radio on Windows, I have finally succeeded! I admit I'm a little delirious with joy and disbelief. I'm answering here because I was getting the exact same error you are, and I suspect you're having the same problem despite the different platform. What worked for me (after ...


1

Try installing python-dev, libffi-dev, libssl-dev, libxml2-dev, and libxslt1-dev packages. Once these are installed, pip install scrapy will work fine. sudo apt-get install python-dev libffi-dev libssl-dev libxml2-dev libxslt1-dev sudo pip install scrapy


0

It could be related to the backend you are using. Here you can find how to get a list of avaliable backends. To use a backend just call matplotlib.use("chosen-backend") at the start of your script. Alternatively I suggest to try and use virtualenv and install all packages (including matplotlib) locally, using pip.


-2

You maybe have more than one python version installed in your system. the pip use the wrong python version run python -V to see the python default version to use you may need to change the pip to use the correct version by opening /usr/bin/pip with your favorite text editor then change: #!/usr/bin/python to the correct version e.g. #!/usr/bin/python2.6


1

Best way to install and update Nylas N1, until it's not in repo is to use : $ wget -O N1.deb "https://edgehill.nylas.com/download?platform=linux" && \ sudo gdebi --n N1.deb && \ rm N1.deb


0

In Eclipse, for python project; we can jump to respective module (source file) and method (function definition). For this, we need to add the packages into PyDev – PYTHONPATH. Project -> Properties -> PyDev – PYTHONPATH -> Add source folder Browse the particular package (source folder) from Project Once done, just click on the search keyword, which ...


0

Move them to ~/.bin (create if it does not exist). Then add them to $PATH by adding the following line to ~/.profile: export PATH=$PATH:~/.bin/ and then, after restarting the terminal, you should be able to run it directly: $ a.out But they won't show up in the graphical search menu. To do that, create a .desktop file: [Desktop Entry] Version=1.0 ...


4

To use a path to the icon is best illustrated with an example. In the example below, I keep the icons in the same directory as the script (indicator), which seems a convenient solution in your case. The bottom line is that once you initiated your indicator: class Indicator(): def __init__(self): self.app = "<indicator_name>" ...


0

try sudo pip install --upgrade youtube_dl. If a module is missing this is how you install it (in this case upgrade/reinstall)


1

Many users on similar QA all had problems because they didn't follow the official installation instructions. If you used apt-get, remove the old version like this : sudo apt-get autoremove --purge youtube-dl Install the new one by using these commands : sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl sudo chmod a+rx ...


-1

Did you try reinstalling youtube-dl ? And after reinstalling try this command youtube-dl -cit https://www.youtube.com/watch?v=50VWOBi0VFs Hope it helps


0

encountered the same problem on the latest Ubuntu 16 Desktop. the quick and dirty fix is to remove the /usr/lib/python2.7/lib-dynload/_hashlib.x86_64-linux-gnu.so file.


2

After a bit of googling and filtering those results, i found something interesting about this issue: apparently there seems to be some sort of compatibility error with the module "http_client". Older versions of (in the example i found) Django (up to 3.1.1) have no issue loading/connecting to the module, where newer versions (3.1.2 onward) seem to get the ...


0

I must say that you must try reinstalling Ubuntu through a terminal. My personal experience is, we must always configure our Python projects in a proper way. For example ( for simplification I just choose a default interpreter):


1

As stated in http://ichi2.net/pyosd/ FAQs Why can I display text interactively, but not in a script? Text is displayed in a different thread, so you need to keep the program running long enough to see the text. Usually this means adding the following function call at the end of your program: my_pyosd_obj.wait_until_no_display() Thus ...


0

Then, try next : sudo apt-get remove node Only Download nodejs from http://nodejs.org/ or using git from https://github.com/nodejs/node but make sure you install the stable branch. For installing please follow the README.md git clone git://github.com/ry/node.git cd node ./configure make sudo make install After installing then ...


0

you can try install 'nodejs' or 'node' : apt-get install nodejs or apt-get install node


0

I have no idea why the errors read the way they did, but by pure luck I did author a functioning code... It goes like this: Plugin #!/usr/bin/env python3 import sys exec(sys.stdin.read()) -Shortcut key: Alt+R ---or whatever you're comfortable with -Save: Nothing -Input: Current selection(default to document) -Output: Display in the bottom pane ...


0

The code needs an older version (before 3.0) of Pillow than the one you have (3.2.0). Try to remove your manually installed Pillow from /usr/local/lib/python2.7/dist-packages/Pillow-3.2.0-py2.7-linux-x86_64.egg and install an older version instead.


0

Before upgrading to Ubuntu 16.04, I had python2.7.5 installed and I assume that during the upgrade, Ubuntu tried to upgrade python from 2.7.5 to 2.7.11 but it failed and so I ended up having the files of python2.7.5 still on the laptop and python2.7.11 partially installed. I solved my error by doing this: removed the partially installed python2.7.11 as ...


1

Ubuntu 14.04 has the lsb_release.py file installed for Python 2.7 as well and lsb_release seems to work under python2.7 as well. You can try this by doing: python2.7 /usr/bin/lsb_release If that works, make a backup of the file /usr/bin/lsb_release and change the first line to read: #! /usr/bin/python2.7 (you can experiment with the -Es options, I ...


0

The first line of /usr/local/bin/ipython is "#!/usr/bin/python3" I could edit that line to use python instead of python3 or it was as simple as run with: python /usr/local/bin/ipython



Top 50 recent answers are included