How do you update to the latest python 3.5.1 versi

2019-04-06 07:46发布

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

2条回答
劳资没心,怎么记你
2楼-- · 2019-04-06 08:32

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!

查看更多
一夜七次
3楼-- · 2019-04-06 08:33
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
查看更多
登录 后发表回答