Tag Info

Hot answers tagged

17

You can't. From the Ubuntu wiki / Python: Longer term plans (e.g. 14.04) Move Python 2 to universe, port all Python applications in main to Python 3. We will never fully get rid of Python 2.7, but since there will also never be a Python 2.8, and Python 2.7 will be nearly 4 years old by the time of the 14.04 LTS release, it is time to relegate ...


8

While reinstalling Ubuntu is probably the easiest way, it's worth pointing out that it's possible to recover without reinstalling everything. To do this, manually download the python2.7 package (and its dependencies), and manually install them using dpkg (bypassing APT, which requires Python). Once that's installed, apt should work again, and so apt-get ...


7

This bit: python2.7-dev : Depends: python2.7 (= 2.7.3-0ubuntu3) but 2.7.3-0ubuntu3.1 is to be installed suggests that you are using some mismatched repositories, or have some apt-pins in place keeping the version dependencies from lining up. I think, specifically, python-2.7 2.7.3-0ubuntu3.1 is in the Precise-proposed repository and the 2.7.3-0ubuntu3 ...


6

You can just install them alongside eachother. sudo apt-get install python2.7 python3 I think by default Python 2.7 will be used (i.e. is symlinked to /usr/bin/python). You can change this by changing that symlink. Most Python programs will specify which version they need and use it automatically. This is not advised, as it is likely to cause programs to ...


6

That's normal. Because tab will align the cursor on the next multiple of 8 column and due to the 4 chars of the prompt, tab will just move the cursor 4 to the left to have it aligned on the 8th column. So that's not the python interpreter, but the terminal that have this behavior. You can see by using a space before hitting tab, it will still be aligned, ...


5

Removing Python is not a good idea as much of Ubuntu depends on it. You may have seen a warning telling you which packages depend on python and thus will be removed with Python. When proceeding you end up with a quite stripped down OS. Reinstalling Ubuntu would now be the easiest and safest way to get it back. Take care not to delete your HOME when you do ...


4

As part of the migration of both Orca and Ubuntu to Python 3, the Python Speech Dispatcher bindings have been migrated to Python 3 and no longer support Python 2. Technically, it would be easy for those bindings to support Python 2 and to package Python 2 bindings, but it has not been done. What can you do about it? I suggest that you use Python 3, which ...


4

Use sudo apt-get --no-install-recommends install pkg1 pkg2 .... To disable installing recommends by default, please see: How can I set up aptitude-curses so that it doesn't automatically select *recommended* packages? (applies to apt-get too)


4

Python is more of a programming language than a program itself but it does have an interactive shell too. Here are your main options. 1. Interactive Shell For playing around in Python, you can just run python and get going. Nothing is saved Open a terminal and run python: $ python Python 2.7.4 (default, Jul 5 2013, 08:21:57) [GCC 4.7.3] on linux2 Type ...


3

Simply copy multiple files at once from command line There are several ways you could achieve this. The easiest I have seen is to use the following. cp /home/usr/dir/{file1,file2,file3,file4} /home/usr/destination/ The syntax uses the cp command followed by the path to the directory the desired files are located in with all the files you wish to copy ...


3

The package python-pythoncard is in universe, so I assume a simple sudo apt-get install python-pythoncard should work. Alternatively, open the Software Center and search for pythoncard. (PS: I am relatively new to this site and believe this should rather be a comment than an answer. But I am unable to give a comment due to a lack op reputation …)


3

Instead of editing the py file, you would simply call the simpleRun.py with the argument: python simpleRun.py -mf /home/lai/Downloads/influence_matrix_file/hprd_inf_.mat or python simpleRun.py --infmat_file=/home/lai/Downloads/influence_matrix_file/hprd_inf_.mat


3

If it's not too late for anyone, or if you have come across this problem lately, this is how I got it running: I followed Mechanical snail's advice and downloaded all the packages using Synaptic. I selected all the relevant packages, basically everything with "python", "python2", "python3", "apt", "python-apt", etc., that was already installed in my ...


3

It is installed by default. You don't need to do anything extra to install it. Python is not an "application" so to speak. It's a language, and the Python 2.7 interpreter is installed by default. You can run it in the terminal to get an interactive shell for the interpreter. If you are waning to learn to program in Python, I'd recommend using the python3 ...


2

You shouldn't install numpy with pip, use the package Ubuntu provides: dennis@koekblik:~$ apt-cache show python-numpy Package: python-numpy Priority: optional Section: python Installed-Size: 7616 ... As to your actual problem: try installing python2.7-dev. It will likely fail but should give you a better error message.


2

The fact that it's in /usr/local/lib means that you've attempted to install numpy 'manually', which can be a fiddly process to get right. The easiest way is to remove /usr/local/lib/python2.7/site-packages/numpy, and make sure the package python-numpy is installed (sudo apt-get install python-numpy).


2

This looks like a bug of Python 2 as something like help("dir") works properly. It probably does not work because print is a special keyword, unlike Python 3. Stick to Python 3 or run the following command instead of help("print"): help("__builtin__.print")


2

This seems to have been a bug in wxGTK. It's fixed in wxGTK 2.8.13 which is not yet available in Ubuntu 12.10. As a workaround make sure not to go directly into the directory you are selecting, but to just select it and then hit Open. This did the trick for me. Please see http://trac.wxwidgets.org/ticket/14525 for more information. As for Python3 ...


2

I also had the same problem. And I was able to fix it going to ctrl+alt+f1, logged in with my username and password then: sudo apt-get update sudo apt-get install --reinstall ubuntu-desktop And it reinstalled most (if not all) the deleted files (along with unity and terminal) :D


2

Winpdb can't locate the glib settings schema which is used for storing preferences. For example, if you look in the Preferences.py file which Quickly auto-generates, you'll see a call to Gio.Settings("net.launchpad.XXX") which retrieves any locally stored preferences for your application, based on the defined schema. The documentation for ...


2

Well, your original problem which mainfests in a SyntaxError exception is a funny one: you started a python interpreter and then trying to run a shell command from there. This won't work. You need to exit the Python interpreter (with Ctrl-D) and execute your file from the shell prompt. The actual command will be the same: python tutorial1.py (provided ...


2

I would not recommend overwriting the system python binaries. I mainly use Perl and Perlbrew for testing code and new Perl releases. You may want to check out something like Pythonbrew that will allow you to maintain your system Python while providing you a sandbox to play in with your newer distribution.


2

General answer if you accidentally remove or overwrite files from packages: Find out to which package your file belongs dpkg -S urllib2.py Answers: python2.7: /usr/lib/python2.7/urllib2.py Reinstall package sudo apt-get install --reinstall python2.7 File is now restored


2

I'm running Ubuntu Precise & the config file is /etc/apache2/sites-available/default. This fragment: ... ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all </Directory> ... maps ...


2

@cyberbills answer is completely correct, but I wanted to add a little more explanation. You aren't supposed to edit simpleRun.py to add your path -- it's already defined, and the "help" argument is there to give you help when you actually run the simpleRun.py script from the command line. To put it another way, the help argument doesn't hold the path, ...


2

Press Ctrl + ALt + T to open a terminal. Write the following in terminal followed by Enter sudo apt-get install ubuntu-restricted-extras A prompt will ask for password, after entering the password type y for yes when asked. Wait for the installation process to over. Now try to run the MP3.


2

You can't, and you don't really want to. Python changed drastically between 2.7 and 3.0, and broke backward compatibility. Python scripts that were written for 2.7, which are used to support a large amount of the system's infrastructure, won't necessarily work properly with Python 3.x. Those scripts need to be updated to work with the new version, and ...


2

Before going to do that you need to start the unoconv listener then only it will start. open your terminal with CTRL+ALT+Tand start the listener as unoconv --listener Then try again with your operation of conversion. NOTE: make sure that no other process using the listener, If any process do so , kill that process to assign the listener to current ...


2

As you noted, the problem is brought by the fact that you have two Python 2.7 installed in two different locations. Specifically, it seems that Python 2.7.3 (from Ubuntu) is using modules from Python 2.7.5 (locally installed). Why this is happening is hard to tell without more information. What I would do is removing Python 2.7.5: if you did not install ...


2

Probably not, so I recommend just downloading the source for now and wait for this version to hit the repos. It wouldn't really make sense to create a PPA for this, since it will be in the actual repos in just a couple of months. Download the source here at its new bitbucket home. Some instructions are also available on the wiki for compiling and installing ...



Only top voted, non community-wiki answers of a minimum length are eligible