posted on 2023-05-07 21:15 read(1082) comment(0) like(1) collect(3)
This installation is mainly for windows development, so it is installed under the windows 10 system.
Python official website : Python Releases for Windows | Python.org
You can find the version you need here and download it, but it is recommended that you do not download the latest version , you know everything. . . After the download is complete, run the installation.
Download the stable version. The specific download version depends on how many bits your computer has. The blogger’s computer is 64-bit, so the installed version is 64-bit 3.7.4 :
Contains three installation types:
Generally choose the exe program to install
Download: 32-bit for windows x86, 64-bit for windows x86-64
The following is the downloaded exe installer:
After downloading the exe, double-click the .exe file to enter the software installation interface, select [ customize Installation ] to customize the installation, and check the [ Add Python to PATH ] option to add environment variables (Python 3.7 to the path), which means to add the Python installation path Add to the Path variable of the system environment variable.
Select the Python installation program and installation location, and then click [ Install ], the software will be installed by default, or if you want to change the location of the installation program, click [ Browse ], select the software installation location in the opened window, and click [ Install] after the selection is complete 】.
After that, wait for the progress bar to be full, which may take a long time.
Finally, the Python installation is complete, click [close] to exit the software installation.
Manually add python environment variable process
You can enter the "Python" command in the command prompt to start the Python interpreter: After executing the above command, the following window information appears:
Possible situations and solutions that python cannot find after installation:
- 1. Close cmd first, then reopen it, then enter "python --version" and press Enter, if it works, it means that cmd was opened and installed;
- 2. Click the downloaded installation package, select repair, and try again according to the prompt;
- 3. If the python version does not appear, the environment variable should not be set properly. Open the Path variable of the system environment variable to check whether there is a Python directory. If not, manually configure the environment variables.
Visual Studio Code (VScode) official website
Select the corresponding version according to your computer system to download
The interface after VScode starts is as shown in the figure below:
To use python in VScode, you need to install the python plugin, as follows:
@id:ms-python.python
After installing python, you need to select the python interpreter . In the VScode interface, press the keyboard shortcut: F1
(or Ctrl
+ Shift
+ P
) , and the text box in the red box in the figure below will be displayed on the top of the VScode interface
Enter Python:Select Interpreter
and select in the command bar, as shown in the figure below:
After that, the corresponding python interpreter will appear, as shown below (mainly depends on the version of python installed on your computer and the path where it is installed):
VScode terminal installation library
pip list to view all installed libraries:
Python official website: Python Source Releases | Python.org
On Linux/Unix systems, the default python version is generally 2.x, and python3.x can be installed in the /usr/local/python3 directory.
- //替换自己需要的版本
- export DOWNLOAD_PYTHON_VERSION=3.7.4
- wget https://www.python.org/ftp/python/$DOWNLOAD_PYTHON_VERSION/Python-$DOWNLOAD_PYTHON_VERSION.tgz
- [root@python tools]# cd Python-3.7.4
-
- [root@python Python-3.7.4]# ./configure --prefix=/usr/local/python3
-
- [root@python Python-3.7.4]# make && make install
- [root@python Python-3.7.4]# ln -s /usr/local/python3/bin/python3.7 /usr/bin/python3
-
- [root@python Python-3.7.4]# ln -s /usr/local/python3/bin/pip3.7 /usr/bin/pip3
- [root@python Python-3.7.4]# python3
-
- Python 3.7.4 (default, Jul 20 2018, 09:24:46)
-
- [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux
-
- Type "help", "copyright", "credits" or "license" for more information.
-
- >>> print("hello world!")
-
- hello world!
-
- >>> exit()
After the installation is complete, you can add the path /usr/local/python3/bin to the environment variable of your own Linux/Unix operating system, so that you can enter the following command through the shell terminal to start Python3.
- $ PATH=$PATH:/usr/local/python3/bin/python3 # 设置环境变量
- $ python3 --version
- Python 3.7.4
- yum install openssl-devel -y
-
- yum install zlib-devel -y
- wget --no-check-certificate https://pypi.python.org/packages/source/s/setuptools/setuptools-19.6.tar.gz#md5=c607dd118eae682c44ed146367a17e26
-
- tar -zxvf setuptools-19.6.tar.gz
-
- cd setuptools-19.6
-
- python3 setup.py build
-
- python3 setup.py install
- wget https://github.com/pypa/pip/archive/9.0.1.tar.gz
-
- tar -zvxf 9.0.1.tar.gz
-
- cd pip-9.0.1
-
- python3 setup.py install
-
- pip3 install --upgrade pip #升级pip3
- [root@mini Python-3.7.4]# pip3 --version
-
- pip 9.0.1 from /usr/local/python3/lib/python3.7/site-packages/pip (python 3.7)
Welcome to the [ python skill tree ] of [ Left Hand の Tomorrow ] , share + follow + comment
Author:Ineverleft
link:http://www.pythonblackhole.com/blog/article/343/4646cbddd466577c0639/
source:python black hole net
Please indicate the source for any form of reprinting. If any infringement is discovered, it will be held legally responsible.
name:
Comment content: (supports up to 255 characters)
Copyright © 2018-2021 python black hole network All Rights Reserved All rights reserved, and all rights reserved.京ICP备18063182号-7
For complaints and reports, and advertising cooperation, please contact vgs_info@163.com or QQ3083709327
Disclaimer: All articles on the website are uploaded by users and are only for readers' learning and communication use, and commercial use is prohibited. If the article involves pornography, reactionary, infringement and other illegal information, please report it to us and we will delete it immediately after verification!