Python environment construction related knowledge

Python language version and development environment

1. Language version: Python 2 and Python 3.
Python 3 generally cannot directly call libraries developed with Python 2, and must use the corresponding Python 3 version of the library (Python 3 is designed to avoid too much cumbersome and backward compatibility is not considered)
2. Python language implementation-Python interpreter

(1) CPython: Python implemented in C language (the original Classic Python implementation);
(2) Jython: Python implemented in Java language, which can directly call Java class libraries, suitable for the development of .net platform;
(3) IronPython: Python implementation for .NET;
(4) PyPy: Python implemented in Python language.

3. The integrated development environment of
Python language Python is a cross-platform scripting language, providing many IDEs on different platforms, which can improve programming efficiency;

(1) IDLE: Python built-in integrated development tool;
(2) Spyder: IDE for scientific computing;
(3) PyCharm: commercial Python IDE developed by JetBrains, supporting enterprise-level development;
(4) Eclipse+Pydev plug-in;
(5) ) Visual Studio+Python tools for visual studio;
(6) PythonWin: an integrated development tool for windows.

Download and install Python

1. Download from official website: search Python directly, then find the official website——>downloads——>find the version you need——>download
If the download is slow, you can copy the download address and go to Thunder to download. The test is fast.
Insert picture description here
Insert picture description here
Find the version you want, click
Insert picture description here
2. After downloading, install it, remember to check "Add Python to PATH"——>Install Now on the first interface.
You can use it after installation.
Test whether it is installed: cmd -> enter python Insert picture description here
3. Install and manage Python extension packages
(1) pip: used to install and manage Python extension packages
(2) setuptools: release the Python package
before using these two, it is recommended to update to it The latest version, otherwise an error will be reported
Insert picture description here

(1) The latest version of the installation package: python -m pip install SomeProject
(2) A certain version of the installation package: python -m pip install SomeProject==1.4
(3) A certain range of the installation package: python -m pip install SomeProject >=1,<2
(4) A compatible version of the installation package: python -m pip install SomeProject~=1.4.2
(5) Update the installation package: python -m pip install -U SomeProject

Note: SomeProject here is the object you want to install
For example: download the NumPy package (provide array and matrix processing, etc.)

C:Users \ jh >python -m -pip install NumPy

For example: update pip and setuptools package Open cmd
with administrator privileges ——> enter:
python -m pip install -U pip setuptools
*not administrator privileges, may [WinError]
Insert picture description here

Use PyCharm to develop Python

Download PyCharm from the official website and install it directly after downloading.
Insert picture description here
Download the relevant package in PyCharm: directly search for
File——>settings in the upper left corner
Insert picture description here
, select the required version, download it, and the download may fail (I am helpless).
Insert picture description here
Supplement: Anaconda is an open source release version of python, mainly for science Technology, with conda (package manager), python, etc. Use it to process data immediately without spending a lot of time installing third-party Python packages.
end.

Guess you like

Origin blog.csdn.net/weixin_44998686/article/details/108691478