Python Is a universal language , Because it is a patched language , Installed Python after , Need any function , You only need to install the corresponding packages , You can use general Python Language to program , Very convenient and easy . There are many advantages of doing this : Cross platform 、 The language is simple 、 The cost of learning is low ; The disadvantage is that the execution efficiency is not high , Need higher hardware computing power . As an auxiliary language, it is very convenient , If you have any new ideas, you can quickly start to test the functions , There are also many online tutorials .
Python There are two main ways to install , One is to use anaconda, It provides Python And the development environment of common libraries , Just one .exe Files can be installed Python The environment directly uses . It's very friendly to Chun Xiaobai .
Another way is to install Python, Then install the required support libraries . The advantage of this method is that you can understand Python The relationship between various packages , I want to know more about the foundation Python Our programmers are very useful .
These two installation methods have detailed installation procedures on the Internet , I won't go into details here , Here is the main introduction Python Installation methods of relevant support packages
pip yes Python Next installation tool , All packages can pass pip To install ,pip Relevant support packages will be installed one by one according to the dependencies of each package . Here is mainly introduced in Windows Installation below .
pip install numpy
pip install Will call foreign servers to download the installation package , Due to the slow download of foreign websites , So configuring the domestic image source will be much faster .
[global]
index-url = http://pypi.douban.com/simple
[install]
trusted-host=pypi.douban.com
After configuration, use pip install When the command is installed, use the default to the specified image source to download .( Alibaba cloud has the fastest download speed in the actual test )
pip The command can also specify the mirror source , It's just a hassle , To manually enter a list of web addresses
pip install pygame -i http://pypi.douban.com/simple
pip install pygame -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
pip In addition to being able to download and install remotely , You can also install it locally , You need to download the corresponding installation package in advance . But many installation packages need other support packages , If there is no support package during installation , You need to download and install the support package first , All support packages are installed , To install the required package . Just like Russian Dolls , One package is better than several support packages . Sometimes you install a package , Various support packages may need dozens or hundreds , Downloading and installing one by one takes a lot of time . But for those that cannot access the Internet and need to be installed, take it as a supplementary method .Python extension packages Can be downloaded from this website
https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyrsistent
After downloading, open the command line , Change the directory to the directory where you downloaded the installation package , And then execute pip install numpy
The Yellow code in the figure indicates : Support package nbbormat Less than , White code prompt : The default URL cannot be found nbformat, Red code prompt : Can't find nbformat, Push installation
Reference resources :