Tag Info

New answers tagged

0

See Is it possible to use Python with the Ubuntu SDK? I don't think that the current status is different: pyqt might not be the best choice in terms of licensing commercial applications And taken from the ubuntu-phone mailing list archive: While PyOtherSide may work, it's not a supported language or platform for the Ubuntu SDK, so we can't ...


0

Depending on how you installed python2.7.8 on your system you may not have the ability to import system modules (i.e installed by apt) from your local interpreter. To workaround the problem and run bleachbit (which only requires python >= 2.6), just use: /usr/bin/python /usr/bin/bleachbit


0

In order to build python3.4.2 from source with the _tkinter module you need to install the following build dependency: sudo apt-get install tk8.6-dev Then all you have to do is running make again to add _tkinter support as the setup.py file will automatically detect the tk/tcl headers and create the module: ~/Downloads/Python-3.4.2$ make running build ...


0

You are getting an error because you are not hashing the users' passwords before saving them. Therefore, john is trying to crack a file that has cleartext passwords in it. Below is an example of hashing is using md5. Obviously you should NEVER use this algorithm for real-world password hashing, but it is an easy way to portray the method. import hashlib ...


0

I was researching a consistent way to notify all X users (as root) and my research (looking at a bunch of places on the net) indicated that although it was possible to use notify-send in this way, it required scripting to find DBUS session info and/or DISPLAY's in use and/or Xauthority file names and locations, and even then sometimes people still couldn't ...


0

This just happened to me after the 14.10 update, and it seems to be because my virtual environments have old copies of /usr/bin/python2.7 that — unlike the new binary — do not include datetime built-in, and so get an error when they cannot find it on disk anywhere. The new interpreter seems to import it without any file I/O (try running it under strace to ...


0

First of all, I (strongly) advice you to remove the python3 version that you installed in /usr/local/lib and use the one that you get from the repo. Having python(3) versions in /usr/local only makes sense if you need different versions from the ones that you can get using apt-get or if you really need a version compiled differently. You can easily get ...


0

I don't think that you need python2.6 to run this application. You'll have to install the following dependencies though: sudo apt-get install libgsl0ldbl python-numpy cython python-pyfits libgsl0-dev python-matplotlib Then in the rm_tools folder of the source, run: python ./setup.py install --user Finally you'll be able to run: ...


2

It's telling you exactly what you need to do: install all those build dependencies. Before I get there, I've said a few times before that I generally don't recommend people use pip (or pip3) to install packages into their global Python install. Both pip and apt-get are completely oblivious to each other. Files can be unduly overwritten or removed and ...


1

Try installing IDLE 3 ( sudo apt-get install idle3 ). Open IDLE 3 and type import speechd and it should work. Does it work? Type help('speechd') to show speechd help.


0

Some of the Pandas source code is written in Cython. The Cython pyx files are turned into .c files and compiled in .so libraries. The error you are seeing, ImportError: /usr/local/lib/python2.7/dist-packages/pandas-0.7.3-py2.7-linux-i686.egg/pandas/_tseries.so: wrong ELF class: ELFCLASS32 says that _tseries.so was compiled as an ELF 32-bit binary, while ...


0

Simply put, this is v1.0, while v2.0 is already available (not as a build though). You can fetch source code from https://github.com/bootchk/resynthesizer and build it.


1

The default python 2.7 on 14.04 is 2.7.6: Python 2.7.6 (default, Mar 22 2014, 22:59:56) [GCC 4.8.2] on linux2 So I think that you installed your own python version which does not see the modules installed by apt-get. Try instead to call python this way (the version installed in /usr/bin): $ /usr/bin/python Python 2.7.6 (default, Mar 22 2014, 22:59:56) ...


1

from itertools import combinations f = open('snc.csv', 'w') for comb in combinations(range(26), 4): f.write("%s,%s,%s,%s\n" % tuple([chr(x + ord('a')) for x in comb])) f.close() EDIT This one will also work and is probably a little easier to read: from string import ascii_lowercase from itertools import combinations f = open('snc.csv', 'w') for comb ...


1

If you think easy_install has anything to do with upgrading the python interpreter itself, my answer is: don't do it. easy_install is a script that installs or upgrades additional python packages - not python itself ... and in almost all cases it is better to use pip for that for quite some years already. The preinstalled python 2.x and 3.x are heavily used ...


2

A quick way would be to add the following lines to a script called .pythonstartup.py and put it in your home directory: import rlcompleter, readline readline.parse_and_bind('tab:complete') Then add the following line to your .bashrc: export PYTHONSTARTUP="/home/YOUR_USERNAME/.pythonstartup.py" Note 1: The .bashrc file is usually located in your home ...


0

So, I resolved this issue by recompiling weechat and upgrading from version 0.4.3 to 1.0.1. It's working like a charm now. $sudo apt-get remove weechatand from here follow the instructions in the readme that accompanies weechat from their website rather than the Ubuntu repo.


0

To install the pyGPs python package, open a terminal with Ctrl+Alt+t and type the following commands: sudo apt-get install python-setuptools python-numpy python-scipy wget https://github.com/marionmari/pyGPs/archive/v1.3.tar.gz tar -zxvf v1.3.tar.gz cd pyGPs-1.3 sudo python setup.py install Now you can run a python interpreter to check that pyGPs is ...


0

Open the terminal and type: sudo apt-get install spyder3 python IDE for scientists (Python 3) Spyder is a free open-source Python development environment providing MATLAB-like features in a simple and lightweight application.


0

ok... Installing nvidia-331-uvm fixed it. It was not included in nvidia-331 and nvidia-cuda-toolkit. sudo apt-get install nvidia-331-uvm


1

Maybe its because you may have installed a numpy for python 2.x series and since you are using python 3.x, it won't work. You should install the python3-numpy package for it to work properly.


0

It is possible to fix this without changing the source code. Create a custom downloader in python: >>> dl = nltk.downloader.Downloader("http://nltk.github.com/nltk_data/") then you open a GUI dialog: >>> dl.download() Check you have write access to the download directory and download what you need.


1

You should send the notify message as the normal main user of your system, (ususally ID 1000): #!/bin/bash MAINUSER=$(cat /etc/passwd|grep 1000|sed "s/:.*$//g") su $MAINUSER -c $"notify-send -i \"/opt/say/logo.png\" \"Title\" \"Message\"" (not sure, how to call it like this in your python script, but I hope it helps)


1

I dont have Ubuntu system right now with me. but still I can help you I think. open your terminal and type as apt-cache search python3-matplotlib If you find it like its available then you can install it from sudo apt-get install python3-matplotlib that is the most preferred way. Now how to use matplotlib with python 3. I have posted a question ...


1

I was able to duplicate the same problem by making changes to PS1 in bashrc. Since I don't know exactly what was edited in your case though, try restoring the previous bashrc file using the following. cp ~/.bashrc ~/.bashrc.bak cp /etc/skel/.bashrc ~/ source ~/.bashrc EDIT: Close and reopen terminal after running this. This fixed the cursor overwriting ...


1

Like I mentioned in my comment, the mediainfo command is really, really slow. There are better alternatives I think. Having said that, here is my version of a python script, that should do the job (python3): #!/usr/bin/env python3 import os import subprocess directory = "/path/to/files" # list the files in the directory files_tosort = ...


1

I quickly made a python script which calls mediainfo process for each file in a search criteria and sorts then by sorting criteria and prints out the results. Modify for your own needs. This uses pure string sorting for the values. You could also add reverse=True for sorted method if wanted or do whatever you want with the code otherwise. This script ...


1

You may find it helpful to check out this thread. Here's a quick summary as suggested in the comments: 1) install python-nautilus and python-mutagen with sudo apt-get install python-nautilus python-mutagen 2) Set your PYTHONPATH variable by following the instructions here. 3) Create a directory called python-extensions in ~/.nautilus 4) Download this ...


0

According to your answer to a different question, you have a python interpreter in /usr/local/bin. As musher pointed out it could not have been compiled to support ucs4. Try with the version installed in /usr/bin instead.


0

Solved problem is I am updating python at location /usr/local/bin but actual installation is in /usr/bin/


0

See this answer http://askubuntu.com/a/418550/4397 In a few words: python2 support is dropped in deb packages for LibreOffice since Ubuntu 13.10. You can also recompile libreoffice with this script https://gist.github.com/hbrunn/6f4a007a6ff7f75c0f8b


0

the root cause of your apt problems is python-lockfile, try to reinstall it with the following command: sudo apt-get clean sudo apt-get update sudo apt-get install --reinstall python-minimal python-lockfile EDIT: You're running 13.10 (which reached its EOL), please update your repositories to install from old-releases.ubuntu.com, see How to install ...


0

You could create a post installation script: gedit debian/*packagename*.postinst This is just a normal script, so the following instructions will do: #!/bin/sh set -e chmod 755 /path/to/pythonscript.py exit 0 Alternatively, you could exclude the file from having its permissions altered by dh_fixperms. This can be done within debian/rules: %: dh ...


1

managed to get it working: for noobs, open your terminal and input: gedit ~/.local/share/applications/OpenWithPython.desktop once open, copy and paste this in the file and save: [Desktop Entry] Name=Python Exec=wine C:/python27/python.exe %F Icon=python Type=Application Categories=Viewer StartupNotify=false Terminal=true MimeType=application/py now ...


0

You can also use pyenv as your python manager. pyenv It will allow you to install any version of python, pypy, python3, stackless etc. it uses shims and also has a nice plugin for virtualenv which makes it a very easy option to use pyenv-virtualenv Very simple installation. curl -L ...


0

Turns out I was being premature. The pyside-uic I downloaded seems to work for both 2.7 and 3.X versions- or at least I haven't found and instance where it doesn't work just yet.


0

Please go to the directory where you have placed the python file and check the following parameters, If you have not already tried with this. Make sure the first line of your file has #!/usr/bin/env python. Make it executable - chmod +x <filename>.py And run it as ./<filename>.py


3

You made a little mistake in your debian/control file where you assumed that the python2.7 package provides the interpreter. /usr/bin/python is actually provided by python-minimal. That's why the following lines in your Makefile don't work as expected in the build environment: PYVER := $(shell python -c "import sys; print sys.version[0:3]") CFLAGS := -g ...


0

This is pure speculation, but your compile command is: gcc -g -I/usr/include/python -Wall -Werror -fPIC -fno-strict-aliasing -DUSESELINUX=1 -c -o dm.o dm.c However, libpython2.7-dev install files in /usr/include/python2.7, according to the file list. Perhaps you should consider different compile flags. There might be something in your system ...


0

The documentation lacks a basic explanation. Let's have a look first at your error. You create an instance of the PDiffer class and then trie to call that instance again. See this very simplified example with the same error: >>> class PDiffer: ... def __init__(self, *args, **kwargs): ... pass ... >>> pdiff = ...


0

The latest mod_python (3.5.0) from http://modpython.org/ supports Apache 2.4 (and also Python 3). In the case of the OP, you're probably better off running mod_wsgi, if all you need is Trac. But for anyone actually depending on mod_python, just upgrade it. Unfortunately there are no .debs, you'll have to compile it yourself.


1

scanner.py should be in the same directory as decoder.py, both in /usr/lib/python3.4/json/. As it's hard to find out why the file got deleted/moved I'd suggest to reinstall libpython3.4-stdlib: sudo apt-get install --reinstall libpython3.4-stdlib


1

My python skills are quite raw, so this will probably be far from the best solution. However: $ python Python 2.7.6 (default, Mar 22 2014, 22:59:56) [GCC 4.8.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import re >>> string = u'下列字符: ><*^|&?\/。、﴾﴿' >>> pattern = re.compile('\w', ...


1

Checkout my Emacs extension emacs-ipython https://github.com/burakbayramli/emacs-ipython It shows the basic of running code through the ipython kernel. Getting error messages was not easy!


0

This worked for me :) Make a backup and edit the file: sudo cp /usr/bin/quirks-handler /usr/bin/quirks-handler.bak sudo gedit /usr/bin/quirks-handler replace the contents with the following code: #! /usr/bin/python3 if __name__ == '__main__': pass Purge nvidia-331: sudo apt-get purge nvidia-331 It will complete successfully, and then you can ...


0

Select "New" there in the "Python Platform Manager". Then It will open a dialog box. Navigate to /usr/local/bin and select python3.4. AT least that works on Windows. If the dialog box does not appear, then in the command field of the new profile type /usr/local/bin/python3.4 and in Console Command type the same thing. In platform name type Python 3.4.1 ...


0

What ended up working for me was installing libncurses-dev sudo apt-get -y install libncurses-dev



Top 50 recent answers are included