Raspberry Pi (Linux system) configuration environment python3

  Under Record How to install a specific version of python on a Linux system. (I did not think you Nongmeitaiyan also took out a forest). I am here roughly divided into two major steps:

1. obtain the installation package

  1.1 raspberries come in with a browser, you can download directly from the official website. URL's official website is:

www.python.org

  After entering the page, click on " Downloads " in this column, select "in the drop-down menu Source code ."
Here Insert Picture Description
  1.2 Select the version of the XZ Compressed Source tarball , that can be compiled archive version.
Here Insert Picture Description
  1.3 find their favorite python version in the next page. Here with Python 3.7.0 , for example, click on " the Download ." This is only a dozen MB, overall or quickly.
Here Insert Picture Description
  1.4 Raspberry Pi download something from the browser are automatically saved in the path / home / Downloads folder, which is shown below:
Here Insert Picture Description
  Of course you can also use the command line to enter this path:

cd ./Downloads

Here Insert Picture Description
  1.5 The archive bit mean tar.xz format, which is compressed inside the outer packaging. The need to deal with this archive command:

tar xvf Python-3.7.0.tar.xz

  There is a new folder, unzip is finished python3.7.0 installation package in the current directory.
Here Insert Picture Description

2. Compile the installation package

  After getting the installation package, we show them, look at the entire command line operation.
  2.1 First, open the installation package:
Here Insert Picture Description
  2.2 using the command "ls", the installation package found things quite a bit.
Here Insert Picture Description
  2.3 installation package has a configure, FIG press instruction execution.
Here Insert Picture Description
  2.4 Finally, the input instruction FIG directly translated, OK Liao.
Here Insert Picture Description
  Pull a little bit, when compiling files are installed should preferably let into the root command-line mode, or some authority to operate can not be executed. Command-line mode to enter the root is relatively simple, the input command "sudo su", the transport of the machine to enter a password.
  2.4 step is not successful, as shown in the image on the first, to make the command line enter root mode, then enter " the make && the make install " command to compile.
Here Insert Picture Description

3. Check the version

  Open a new command window enter " python3 " python enter edit mode, where you can see the version number is 3.7.0, the installation was successful.
Here Insert Picture Description
  Python need to exit edit mode, you can enter "quit ()", after the carriage return will withdraw.
Here Insert Picture Description

Installation pip

  pip is used to install python support package, we need to click. Here to windows10 system as an example.
  First enter the official website www.pypi.org, download files red circle.
Here Insert Picture Description
  After downloading extract it better.
Here Insert Picture Description

  Open the folder.
Here Insert Picture Description

  Hold down the shift key, right-click on the folder in the space, select " open powershell window here ", enter the following command:

python setup.py install

Here Insert Picture Description
  Executing the OK.

Published 54 original articles · won praise 18 · views 9561

Guess you like

Origin blog.csdn.net/m0_37872216/article/details/103102116