Tried to use
sudo apt-get install python3.5
and it's telling me that it can't find it. Have tried updating. Not sure what else to do.
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It only takes a minute to sign up.Sign up to join this community
I tried installing the python3.5.2 with the below steps and I was successful.
1. wget https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tar.xz 2. tar -xvf Python-3.5.2.tar.xz 3. cd Python-3.5.2 4. ./configure 5. make 6 make altinstall
Once the installation is completed
which python3.5 command to get the binary location
In my case it was installed in the location
To get into the REPL of 3.5 type
python3.5 on your terminal. The existing python distribution remains intact without issues. Verify that using the python. I have tried installing python 3.4 and 3.5 versions.
pi@raspberrypi:/etc/openhab/configurations $ python -V Python 2.7.9 pi@raspberrypi:/etc/openhab/configurations $ python3.5 -V Python 3.5.2 pi@raspberrypi:/etc/openhab/configurations $ python3.4 -V Python 3.4.2
Also as time permits I suggest you to read the article https://stackoverflow.com/questions/16018463/difference-in-details-between-make-install-and-make-altinstall.
It should work. The only issue while i faced during installation is the time taken for the whole process. It took almost 3 hours because a lot of time is consumed in compiling the binaries and then installing python.
First of all you need to get your dependencies right. That mostly depend on what you have already installed previously. So for a vanilla fresh Raspbian (jessie), you will (approximately) need to make sure you have these:
sudo apt-get install build-essential libc6-dev sudo apt-get install libncurses5-dev libncursesw5-dev libreadline6-dev sudo apt-get install libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev sudo apt-get install libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev
The rest is simple. First download and extract...
cd $HOME wget https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tgz tar -zxvf Python-3.5.2.tgz
...and then compile with:
cd Python-3.5.2 ./configure # 3 min 13 s # We have 4 processors, so let's use 4 threads make -j4 # 8 min 29 s sudo make install # ~ 4 min
Save your SD card space:
cd .. sudo rm -fr ./Python-3.5.2*
Now test with:
cd python3 --version # output: "Python 3.5.2" pip3 list # output: # pip (8.1.1) # setuptools (20.10.1) # You are using pip version 8.1.1, however version 8.1.2 is available. # You should consider upgrading via the 'pip install --upgrade pip' command.
Update your default
pip installation with:
sudo pip3 install -U pip sudo pip3 install -U setuptools