程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Installation of Python and related packages: pip, jupyterab, numpy

編輯:Python

title Python And the installation of related packages :pip、jupyterlab、numpy

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 install

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 install

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 .

  1. stay C:\Users\administrator( User name or ) Create under directory pip Folder , Create... Under it pip.ini Startup file
  2. stay pip.ini Enter the following configuration items in the startup file
[global]
index-url = http://pypi.douban.com/simple
[install]
trusted-host=pypi.douban.com
  1. The configured content is the URL of the image source , Here is the image source of Douban , You can also use other image sources
  • douban (douban) http://pypi.douban.com/simple/
  • Alibaba cloud http://mirrors.aliyun.com/pypi/simple/
  • Tsinghua University https://pypi.tuna.tsinghua.edu.cn/simple/
  • University of science and technology of China https://pypi.mirrors.ustc.edu.cn/simple/
  • University of science and technology of China http://pypi.mirrors.ustc.edu.cn/simple/

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

Offline installation

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 :

  1. How to configure pip install Domestic image source accelerates installation ?
  2. windows10 The configuration pip Source and install pip package

  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved