Raspberry Pi upgrade to Python 3.6

1. Update the Raspberry Pi system

$ sudo  apt-get  update
$ sudo  apt-get  upgrade -y

2. Install the python-dependent environment

$ sudo apt-get install build-essential libsqlite3-dev sqlite3 bzip2 libbz2-dev

3. Download and extract the source code version python3.6

$ Wget https: // www.python.org/ftp/python/3.6.1/Python-3.6.1.tgz 
$ takes zxvf Python 3.6 . 1 .tgz 
$ cd Python - 3.6 . 1

4. compile and install, due to the compilation process is relatively long, we can be compiled and installed a few commands together, so you can go to a cup of coffee, some time will prompt successful installation.

sudo ./configure && sudo make && sudo make install

5. Establish flexible connection
after installing python3.6 we can look at the version of python

@ raspberrypi PI: ~ $ Python - Version 
output: Python 3.4 . 2 
PI @ raspberrypi: ~ $ python3 - Version 
output: Python 3.6 . 1

6.

Next Python 3.6.1 software required to link to the python, so easy to use.

Python3 and look at the python command, respectively, in that

pi@raspberrypi:~ $ which python
输出:/usr/bin/python
pi@raspberrypi:~ $ which python3
输出:/usr/local/bin/python3

7. Then establish a flexible connection

pi@raspberrypi:~ $ sudo mv /usr/bin/python /usr/bin/python3.4.2 
pi@raspberrypi:~ $ sudo ln -s /usr/local/bin/python3 /usr/bin/python

8. good, so soft successfully established a connection.

Whether the test was successful

@ raspberrypi PI: ~ $ Python - Version 
output: Python 3.6 . 1

OK, you can come see the python raspberry has been successfully upgraded to the Python3.6.1

Guess you like

Origin www.cnblogs.com/yikemogutou/p/12335186.html