python 使用pip安装第三方模块

时间:2023-03-22 12:21:08

part 1:使用方法:

1.pip install somePackage

picture 1

python 使用pip安装第三方模块

2.pip show somePackage

例如:pip show pip

弹出关于该模块的信息

picture 2:

python 使用pip安装第三方模块

3.pip list

list 已经安装的模块

4.pip install --upgrade somePackage

例如:pip install --upgrade pyperclip

5.pip uninstall somePackage

例如:pip uninstall pyperclip

会问你:y/n

参考:pip docs:https://pip.pypa.io/en/stable/quickstart/

使用心得:宿舍网速比较差,安装容易失败

     办公室网速比较好,安装均成功

       可能原因:网速,配置,*的节点,使用的是.81的节点

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

另外一种方法:(不推荐)

1.从pypi上下载python的第三方模块安装包(压缩文件)
2.解压
3.windows shell —>cmd-->cd: C:\users\sxhui101\requests-2.11.1 # setup.py的放置的地方
4.输入:python setup.py install
5.ok 

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

part 2:使用python镜像源加速第三方库在线安装(推荐)

例如:pip install pandas -i https://pypi.douban.com/simple

参考:http://www.cnblogs.com/yudar/p/4444097.html