Hello Linux Geeksters.
In this article I will show you how to install Python 3.3, the latest Python version available on Ubuntu 13.04 Raring Ringtail, Ubuntu 12.10 Quantal Quetzal and Ubuntu 12.04 Precise Pangolin.
You can install Python 3.3 via PPA, on Ubuntu 12.10 and Ubuntu 12.04:
Install dependencies:
$ sudo apt-get install python-software-properties
Add the repo:
$ sudo add-apt-repository ppa:fkrull/deadsnakes
Update the repo index:
$ sudo apt-get update
Install Python 3.3:
$ sudo apt-get install python3.3
Installing Python 3.3 on Ubuntu 13.04:
Because there is no PPA for Ubuntu 13.04, we’ll do an installation from sources.
Installing the dependencies:
$ sudo apt-get install build-essential libsqlite3-dev sqlite3 bzip2 libbz2-dev
Download and compile python:
$ wget http://python.org/ftp/python/3.3.0/Python-3.3.0.tar.bz2
$ tar jxf ./Python-3.3.0.tar.bz2
$ cd ./Python-3.3.0
$ ./configure --prefix=/opt/python3.3
$ make && sudo make install
Some nice touches to install a py command by creating a symlink:
$ mkdir ~/bin
$ ln -s /opt/python3.3/bin/python ~/bin/py
This helped me. Thanks much!
I installed python3.3 from deadsnakes as said – very useful.
can you tell me will this replace the current version installed or just install another Python
install another python. to have only python 3.3, remove the existing python from your system before you install python 3.3:
$ sudo apt-get remove –purge python*
Umm that would probably be a bad idea since Ubuntu still needs python2.2 for compatibilty until they port everything over to python3.
If you got rid of python2 you might brick your install.
i have linux ubuntu 12.04.2 and it comes with the default 2.7.3
i want to upgrade to 2.7.5 maybe replace 2.7.3
The app i run picks 2.7.3 how do i tell it to use 2.7.5 thanks
humm now i have trouble with python path changed lol
ImportError: No module named acestreamengine.core
i did this now
raceback (most recent call last):
File “/usr/lib/python2.7/site.py”, line 562, in
main()
File “/usr/lib/python2.7/site.py”, line 544, in main
known_paths = addusersitepackages(known_paths)
File “/usr/lib/python2.7/site.py”, line 271, in addusersitepackages
user_site = getusersitepackages()
File “/usr/lib/python2.7/site.py”, line 246, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
File “/usr/lib/python2.7/site.py”, line 236, in getuserbase
USER_BASE = get_config_var(‘userbase’)
File “/usr/lib/python2.7/sysconfig.py”, line 577, in get_config_var
return get_config_vars().get(name)
File “/usr/lib/python2.7/sysconfig.py”, line 476, in get_config_vars
_init_posix(_CONFIG_VARS)
File “/usr/lib/python2.7/sysconfig.py”, line 337, in _init_posix
makefile = _get_makefile_filename()
File “/usr/lib/python2.7/sysconfig.py”, line 331, in _get_makefile_filename
return os.path.join(get_path(‘platstdlib’).replace(“/usr/local”,”/usr”,1), “config” + (sys.pydebug and “_d” or “”), “Makefile”)
AttributeError: ‘module’ object has no attribute ‘pydebug’
any ideas?
thank you very much.
while am installing python on ubuntu12.10 in first step only i got this message what can i do now
E: Could not get lock /var/lib/dpkg/lock – open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
your dpkg has been locked, due to unsuccessful installations. to unlock it, do:
$ sudo rm /var/lib/dpkg/lock
Next, perform the instructions from the article
very good