简体   繁体   中英

Python 3.2 installation on Ubuntu 12.04

I am trying to install python 3.2.3 on my ubuntu machine, which is 12.04, but I do not want to disturb the current 2.7 installation. After searching on the internet, I found a reference here . I followed the instructions, but when trying to run

sudo apt-get install build-essential libncursesw5-dev libreadline5-dev libssl-dev libgdbm-dev libc6-dev libsqlite3-dev tk-dev

I get an error saying that

E: Package 'libreadline5-dev' has no installation candidate.

What am I missing? Is there any other way to install python 3.2 on ubuntu? If I use apt-get , will it disturb the current installation?

You can install as many Python versions as needed. A call to python from the shell will execute python2.7 (you can check that by executing ls -l /usr/bin/python ), python 3.2 can be called also as python3 .

If you have even more versions, these can be accessed directly with their numbers as python2.6 etc. I personally have versions 2.5, 2.6, 2.7 and 3.2 installed for compatibility reasons.

libreadline5-dev has apparently been replaced by libreadline6. You should be able to get it just by installing libreadline-dev and letting the package manager figure it out:

roger@roger-HP-Z800 ~/Downloads $ sudo apt-get install libreadline-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libreadline6-dev libtinfo-dev
The following NEW packages will be installed:
  libreadline-dev libreadline6-dev libtinfo-dev
0 upgraded, 3 newly installed, 0 to remove and 262 not upgraded.
Need to get 370 kB of archives.
After this operation, 1,241 kB of additional disk space will be used.
Do you want to continue [Y/n]? Y

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM