Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you update to the latest python 3.5.1 version on a raspberry pi?

I got my Raspberry Pi yesterday and I am already trying to code with it. I have a program that I was planning to run on it but it is only compatible with Python versions 3.5.0 or 3.5.1 and everything I find on the internet seems to either be outdated, to do with Python 2 or doesn't relate to my problem as I haven't seen anything else that 100% requires Python 3.5 and can cope with 3.4(currently pre-installed). .exe files don't work on Linux. I am new to the Raspberry Pi and with Linux as I have always been a Windows user. Any help is appreciated. Many Thanks - Robert

like image 398
Robert Vasistha Avatar asked May 06 '16 18:05

Robert Vasistha


2 Answers

cd ~
wget https://www.python.org/ftp/python/3.5.1/Python-3.5.1.tgz
tar -zxvf Python-3.5.1.tgz
cd Python-3.5.1
./configure && make && sudo make install
like image 156
RaviTezu Avatar answered Oct 20 '22 01:10

RaviTezu


I would compile it myself (and indeed, have a few times). I'm assuming that you're running Ubuntu or Raspbian. You should be able to install the dependencies:

$ sudo apt-get install build-essential \
                       libncursesw5-dev \
                       libreadline5-dev \
                       libssl-dev \
                       libgdbm-dev \
                       libc6-dev \
                       libsqlite3-dev tk-dev \
                       libbz2-dev

Then go download the source and extract it, and then install it:

  $ tar -xzvf https://www.python.org/ftp/python/3.5.1/Python-3.5.1.tgz
  $ cd Python-3.5.1
  $ ./configure && make && sudo make install

If you're missing a dependency it will probably die at the ./configure step. But if everything works, you'll have a brand new Python 3.5 install on your Raspberry Pi. Congrats!

like image 31
Wayne Werner Avatar answered Oct 20 '22 01:10

Wayne Werner