New answers tagged

3

Three Major Questions I broke your question into the three areas you were concerned about. While I can't help you write a FUSE file system, I can answer those 3 questions: Quoting Wikipedia:In computer programming, unit testing is a software testing method by which individual units of source code, sets of one or more computer program modules together ...


0

Had the same error. Try easy_install hashlib


0

I'm aware that I can built a text file and tell rsync --exclude-from 'textfile' but I'd rather not have to read and rewrite a text file. Just do: with contextlib.closing(tempfile.NamedTemporaryFile()) as exclude_from: print(*your_exclude_list, sep="\n", flush=True, file=exclude_from) # etc subprocess.check_call(['rsync', '--exclude-from', ...


1

I've discovered that my size limits aren't necessarily in a command's length, but rather in the argument's length. Shell commands can be at 100,000-200,000 characters in length. Arguments however are limited to a few hundred characters depending on the system, as discovered by using getconf ARG_MAX. This leads me to the eventual problem of running out of ...


-1

It is a problem with the development files of libgeos. I have the same problem and it was resolved by installing those libraries. Hope it helps.


0

The error MSG states "python 2.7" but you are importing python3 modules. Make sure you use something like #!/usr/bin/env python3 At the top of your script, or invoke it with python3 explicitly. Mind you, there seem to be a problem with python3's GstPbutils too :(


1

As described in this post on StackOverflow this is a "known bug". On Github, they explain that when freetype-config is missing the setup.py crashes. The output of the error message looks a bit different in this one but it seems like it can be handled just as explained in the link that I posted. By typing: sudo apt-get install libfreetype6-dev libxft-dev ...


0

One available option is to use saltstack to execute the same command on each minion. After adding salt to each computer you can run the same command on each machine with something like salt '*' cmd.exec_code python 'import sys; print sys.version' If you are using blender's network render addon then you could also configure a blend file to have network ...


1

OP solved the problem: ...I found the problem. I was using the wrong python since I had installed anaconda. Removing anaconda make the system works An alternative way without uninstalling Anaconda, reset python link to default (pointing to python2 from repository) $ ls -l /usr/bin/python lrwxrwxrwx 1 root root 9 Dec 10 2015 /usr/bin/python -> ...


0

A manually installed Python-[any-version] has no uninstall. The only method is to delete the files. Suggest : cd Python-3.5.0/ && sudo make install 2>&1 | tee install.log.txt Analyze the install.log.txt, and decide if it is possible to delete the installed files, without disturbing the default python3.5 ( /usr/lib/python3.5, etc.) and ...


0

idle3 is a package that depends on idle-python3.5, python3 and python3-tk (module for portable GUI with Tkinter). Here is a visualization of the dependency relationship between the differents packages.


1

This is probably caused by having an outdated version of pip. You can upgrade pip by running: sudo pip install -U pip


0

If you get vim-nox, you'll have python 3 support: sudo apt-get install vim-nox Then: $ vim --version VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Apr 08 2016 11:38:28) Included patches: 1-1689 Modified by pkg-vim-maintainers@lists.alioth.debian.org Compiled by pkg-vim-maintainers@lists.alioth.debian.org Huge version without GUI. Features included (+) or ...


0

I don't understand the error what they are, but could manage to make it work. I have used the following commands sudo apt-get install python-pkg-resources=3.3-1ubuntu1 sudo apt-get install python-setuptools pip install pywavelets and it solved my problem.


1

The solution is here: http://stackoverflow.com/questions/36394101/pip-install-locale-error-unsupported-locale-setting Since I am running python2.7: $uname -a Linux tools1-itigo-tech 4.4.0-24-generic #43-Ubuntu SMP Wed Jun 8 19:27:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux $python --version Python 2.7.11+ $unset LC_ALL $pip install xmltodict Traceback (most ...


0

Try to import PIL before tensorflow. In your case, just put "import tensorflow as tf" after all other imports.


0

You can install IDLE for Python 3 by installing the idle3 package in the Ubuntu repositories: sudo apt-get install idle3 For Python 2, replace idle3 with idle.


0

Thanks AstronomyGeek ! However, some typos in the script: mv ./compiler-rt-3.7.1.src ./compiler-rt mv ./compiler-rt ./llvm-3.7.1/projects/' and unnecessary to have ../llvm-3.7.1/configure –help


2

You can do this using the os module: #!/usr/bin/env python import os output = os.listdir('path_to_folder') # output is a list # Do whatever you want to output You can read more about what else the os module can do at https://docs.python.org/3/library/os.html. Note that the methods in the module are portable across different OSes, so you can in fact use ...


2

If you really need a terminal, you're probably going to have to drum up a pty and connect stdin and stdout to it, then use the Subprocess module to run your application. Even that won't filter out any curses escape sequences or ASCII graphics (why else would you need a terminal?) but if the app is checking for the presence of a terminal, it would work. If ...


3

What you need is a lock file and check for this lock file. If it is there end the script otherwise start it. An example command would be shlock. DESCRIPTION Shlock tries to create a lock file named name and write the process ID pid into it. If the file already exists, shlock will read the process ID from the file and test to see if the ...


0

Pydev 5.0 requires Java 8 as mentioned on their home page. Version 4.5.5 is the last release to support Java 7.


0

I would consider using virtual environments instead of installing python versions via apt-get. Using virtual environments, see here, are a good practice for developing with python. They let you isolate your python environment from the system installed python versions. In addition you don't have to get sudo access while installing any library (via pip ...


2

Looks like you built or installed a custom Python in your home directory (~/Desktop/my-android-toolchain). Probably this custom Python installation shadows the system Python. You can check which executable is getting run using the command which python It should report something like /usr/bin/python. This is the system's Python installation that is ...


1

With the venv module available from Python 3.3 (and Ubuntu 15.10) Virtual environments (venvs) are so popular that the functionality is now included in python itself (from 3.3 onwards). To use it on Ubuntu you need to install python3-venv (since the ensurepip module is not available): sudo apt-get install python3-venv After that you can use pyvenv ...


0

On terminal type: sudo apt-get install --reinstall python3.4 That will fix your problem, if this does not help install it using: dpkg -i {The full name of python 3.4 package deb file}


2

I managed to build LLVM 3.7.1 using the following steps. I am not sure if this is the 'proper' way to do it, but hopefully others can correct me if any of the steps are wrong. This was largely based on http://linuxdeveloper.blogspot.com/2014/06/building-llvm-342-from-source.html mkdir llvm cd llvm wget http://llvm.org/releases/3.7.1/llvm-3.7.1.src.tar.xz ...


0

Thanks for your comments. I've tried Jos' suggestion of adding the following lines to the beginning of tax_rates.py: import sys reload(sys) sys.setdefaultencoding('utf8') I was happy to see that the script now does run and produces a plot (see below a screenshot from Atom editor). I would welcome a more 'permanent' solution, though. P.S. For your ...


0

As the output says, MRTG is already installed: mrtg is already the newest version. However, the package pbis-open errored during installation. One way that might fix this is the command sudo apt install --reinstall pbis-open Also, you have a lot of orphaned packages installed (dependencies that were installed but are not longer required) You can ...


1

If I understand you correctly, you would like to extract the local videos you're watching, not things like Youtube? In that case, you might want to have a look at the Gnome Activity Journal. It tells you what you've watched and when you did it, by time and date. This is accomplished using Zeitgeist, for which there is a library for Python if you want to do ...


0

For a novice it might be the most efficient to just download a preconfigured VB-Image. In any case, it is a definite time-saver. Check http://www.osboxes.org/ubuntu/ p.s. Don't forget to install virtualbox extension pack on the host and guest-additions inside of the guest.


1

There are currently two bugs related to snaps which block this, both are in the works to be fixed though: https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/1576411 https://bugs.launchpad.net/ubuntu/+source/snapcraft/+bug/1576282 Can you check the contents of your snap and see if there are any encodings modules shipped?


1

It is asking where your Ubuntu ISO is. If you have not downloaded it: 32-bit Ubuntu 16.04: http://releases.ubuntu.com/16.04/ubuntu-16.04-desktop-i386.iso 64-bit Ubuntu 16.04: http://releases.ubuntu.com/16.04/ubuntu-16.04-desktop-amd64.iso Then select the file. :)


0

I ran into essentially the same issue, but for python-minimal 2.7.11-1. cat /var/lib/dpkg/info/python-minimal.postinst You should get something like this: #! /bin/sh set -e python2.7 -m compileall /usr/share/python/ >/dev/null Run the command without redirect to >/dev/null (edit the file, or: sudo python2.7 -m compileall /usr/share/python/). This ...


2

You can create new bash files simply with creating a new file and making it executable. e.g. touch simplebash.sh now add the shebang to the file so it knows in which shell you actually want to run the script. You can do this with this simple echo forward or just simple edit the file with an editor echo "#!/bin/bash" > simplebash.sh Change the ...


1

Ok, I solved this with the following code: class MainWindow(QMainWindow): def __init__(self, filelist, **kwargs): openFileAtStart(filelist) def openFileAtStart(self, filelist): matching = [s for s in filelist if ".myformat" in s] if len(matching) > 0: self.openFileByName(matching) if __name__ == "__main__": ...


0

See here. The package version requires Cudnnv4. So either you switch to cudnnv4 you install tensorflow from source as indicated in the link above


5

As @dufte has pointed out in his comment to the question, pymorph does not exist in the Ubuntu repositories. However, pymorph does exist in PyPI. The best way to install pymorph is to use pip inside a virtualenv; I would avoid using sudo pip because it is best to get apt manage your system packages and not let pip interfere with that. Assuming you are using ...


3

sudo apt-get install pymorph fails because pymorph does not exist as package in the apt sources. If you want to know whether a package exists or not, you can run apt-cache search [packagename]. In this instance, running apt-cache search pymorph returns nothing. parto@subroot:~$ apt-cache search pymorph parto@subroot:~$ To install pymorph, use pip. ...


2

The correct way is to do this is to install virtualenv using apt, create a virtualenv and then activate it. After activation, use pip to install Python packages as usual. sudo is only used to install virtualenv and not on pip, therefore preventing pip from competing with apt to manage Python packages at the system level. The code to do so is: sudo apt ...


0

Unfortunately, I do not currently have the ability to comment on this Stack Exchange site, but I will attempt to make this answer more complete than a comment. (I would recommend accepting eyoung100's detailed answer.) Python is a scripting language that is used in many programs. When you see "python" in the process list, it is actually the python ...


3

Long Answer The General Python FAQ states: Python is an interpreted, interactive, object-oriented programming language. It incorporates modules, exceptions, dynamic typing, very high level dynamic data types, and classes. Python combines remarkable power with very clear syntax. It has interfaces to many system calls and libraries, as well as to various ...


4

Instead of doing su root, you should use sudo instead, as the root account is not enabled by default in Ubuntu, and will not work. This is why you are getting an "Authentication failure" message. Regarding password entry - it won't show you anything as you type, but, it will accept your password after you press enter. Make sure you entered the right ...


1

Not a dupe, but in the accepted answer on this question, it is explained how to run a script (or any command) whenever a file is added or created in an arbitrary directory. In your case, the only needed event- trigger is: -e create Furthermore, since you are not using the path to the file as an argument, you can skip the --format -section. The script to ...


0

Here is a trimmed down version of the example from the inotify page on PyPI (https://pypi.python.org/pypi/inotify) to get you started: import inotify.adapters import os notifier = inotify.adapters.Inotify() notifier.add_watch('/home/student') for event in notifier.event_gen(): if event is not None: # print event # uncomment to see all ...


0

You need to install the tk-dev package by running sudo apt install tk-dev. Then, reinstall matplotlib in the virtualenv by running pip --no-cache-dir install -U --force-reinstall matplotlib. python -c 'import matplotlib as mpl; print(mpl.get_backend())' should now say TkAgg.


1

Eric Python IDE is great and has lots of features like auto completion, error highlighting, debugging and is nicely laid out for managing large projects. You can also design forms. It has everything I need to get started with Python projects. Best of all, it's easy to install with just sudo apt-get install eric or visit the Software Center and install ...


2

You are missing: A .desktop file to be installed in /usr/share/applications/ for Dash/App Menu listing/launching. An icon to be installed in /usr/share/icons/ for this .desktop launcher. Another little bit different .desktop file to be installed in /etc/xdg/autostart/ for session autostart. XD I will not give you examples! You know why? Update to fix ...


0

I digged in, and found a solution: As you mentioned: sudo add-apt-repository ppa:syseleven-platform/xenial-ports sudo apt update && sudo apt install python-support python-imaging python-imaging was the last thing you needed. It is working for me now


1

Not all python files will have the file extension .py - Try running grep -rni python /usr/bin for example). Most of these scripts will have a 'shebang' (or hashbang) line (e.g. #!/usr/bin/env python, #!/usr/bin/python2.7). This informs the interpreter of the script which program needs to be used to run it, and you could search for this to find python files ...



Top 50 recent answers are included