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 ...


11

A simple safety way would be to use an alias, by placing: alias python=python3 into ~/.bashrc or ~/.bash_aliases file.


11

plugins/python/uwsgi_python.h:2:20: fatal error: Python.h: No such file or directory To compile C extensions for Python you need Python development files: $ sudo apt-get install python2.7-dev


9

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 ...


9

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 ...


7

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 ...


7

Don't do it Since many important programs are written in python changing default python may crash your system, so set python for individual apps. You can locate python3 at /usr/bin/python3 . If you want python3 by default try Ubuntu 12.10


6

Adding to Bryan's answer, if you simply want to compile a file or a bunch of files from a terminal, the py_compile module can be executed as a script in the following manner: python -m py_compile fileA.py fileB.py fileC.py


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

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 ...


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 ...


4

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

If you want only H.264 then sudo apt-get install h264enc will install H.264 in your system.


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

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 ...


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 ...


3

Edited the answer from the question. There was an error in the tutorial, in the line sudo ln -s /usr/lib/python2.7/dist-packages/ /opt/stackless/lib/python2.7/site-packages When I removed the link, and instead ran sudo ln -s /usr/lib/python2.7/dist-packages/ /opt/stackless/lib/python2.7/dist-packages Everything worked as expected, and I now ...


3

Your parens in the equation for z are unbalanced.


3

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.


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 ...


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

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

Make sure the directory /home/robin/.config/RedThat/ exists before trying to create a file in it.


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

Nobody helped me =( But I found solution: reinstall package "ca-certificates" helped me)) Thanks to this log =) http://irclogs.ubuntu.com/2012/05/26/%23kubuntu-devel.html


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 ...



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