简体   繁体   中英

How to install python version 3.5.6 into ubuntu/ Linux?

I need to install python version 3.5.6 . What are the requirements to install python 3.5.6.

python 3.6 is already installed on my local machine

What I have tried?

  1. I looked into Python downloads . Downloaded tarball for python3.5.6 .
  2. Installed it by using following set of commands
     wget https://www.python.org/ftp/python/3.5.6/Python-3.5.6.tar.xz tar -xf Python-3.5.6.tar.xz cd Python-3.5.6 sudo apt-get install libbz2-dev libsqlite3-dev build-essential ./configure make sudo make install 
  3. After installation when I run python3 -V it shows python 3.6 .

Expected behaviour

python3 -V command should show python3.5.6

What I am doing wrong?

Try uninstalling it or removing the package all together from your computer. Afterwards try:

$ sudo apt-get install --reinstall python3.5

or you could try:

$ sudo aptitude reinstall python2.7

Best of luck.

python3.5 might show 3.5.6 , depending on where and how things are on your PATH.

Either way, instead of manually compiling and installing Python (especially as you're side-stepping your package manager ( apt ) here which may cause trouble down the line), look into pyenv . After installation, approximately:

$ pyenv install 3.5.6
$ pyenv local 3.5.6
$ python

and you're ready to roll.

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