1
votes

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

3
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

3 Answers

0
votes

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

0
votes

I followed this answer and solved my problem with old version of python 3.4 and successfully installed python 3.5 on another location. This hack avoid conflict with two versions.

0
votes

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.