Install Python 3.2 on Ubuntu 12.04

I am trying to install python 3.2.3 on my ubuntu machine which is 12.04, but I don't want to break the current installation of 2.7. After searching the internet, I found the link here . I followed the instructions, but when I try 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

E: The package 'libreadline5-dev' does not have a candidate for installation.

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

+6
source share
2 answers

You can install as many versions of Python as possible. Calling python from the shell will do python2.7 (you can verify that by running ls -l /usr/bin/python ), python 3.2 can also be called like python3 .

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

+12
source

libreadline5-dev seems to have been replaced by libreadline6. You can get it by simply installing libreadline-dev and telling the package manager:

 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 
0
source

Source: https://habr.com/ru/post/921767/


All Articles