0

Im on Ubuntun 17.2 and I have Python version 3.4.3 installed. However for a package to install I need Python 3.5. Trying to simply use the apt-get routine only that python3 is up to date. Trying to directly specify the version of python via

sudo apt-get install python3=3.5

only tells me that the version does not exist. Can anyone help?

Edit: Adding the repository mentioned in the comments allowed me to install python3.5. However the package still will not install. The package that I want to install is called kwant. I try installing it by cloning into git:

sudo pip3 install git+https://gitlab.kwant-project.org/kwant/kwant.git

However I still get the error

Error: Python 3.5 required, but 3.4.3 is installed

Suppenkasper
  • 845
  • 4
  • 10
  • 29
  • 1
    This might help: https://askubuntu.com/questions/682869/how-do-i-install-newer-python-versions-using-apt-get – user3486184 Aug 07 '17 at 21:16
  • 1
    The version of python that you have in linux by default is the one provided by the developers of your linux distribution, the time between the last version and the version of your python OS is different since they take the time to test it. If you want to have a current python version I recommend installing a virtualenv. – eyllanesc Aug 07 '17 at 21:16

2 Answers2

0

Update! I found that : The repository is no longer updated on a regular basis, and should be regarded as outdated as by the owners announcement

sudo add-apt-repository ppa:deadsnakes
sudo apt-get update
sudo apt-get install python3.5

or try this way

sudo apt-get update
sudo apt-get upgrade

(this method isn't tested by me but may help you):

sudo apt-get install libssl-dev openssl
wget https://www.python.org/ftp/python/3.5.7/Python-3.5.7.tgz
sudo tar -xzvf Python-3.5.7.tgz
cd Python-3.5.7
./configure
sudo make
sudo make install

https://www.youtube.com/watch?v=jpdFwfGFlq8

anthony sottile
  • 61,815
  • 15
  • 148
  • 207
  • Thank you. That is the same Repository mentioned in the comments above. I tried this and It installed Python3.5 without problem, however (as I edited) it does not yet solve the Problem – Suppenkasper Aug 08 '17 at 07:53
  • have yout tried this way -> sudo apt-get update then -> sudo apt-get upgrade – Dragosh Munteanu Aug 08 '17 at 07:59
0

I would recommend creating a new virtual environment with the desired python version and install the dependencies from the start, as well since while installing the dependencies, the wheel is based on the python version and dependencies installed for another python version can be problematic. You can check my answer to this question, too.

aargun
  • 126
  • 4