0
点赞
收藏
分享

微信扫一扫

Python pip

pip 是 Python 包管理工具,该工具提供了对 Python 包的查找、下载、安装、卸载的功能。

1. 查看 pip 的版本可以使用以下命令:
pip --version

2.下载安装包使用以下命令:
pip install some-package-name

例如安装 numpy 包:
pip install numpy

3. 通过以下的命令来移除软件包:
pip uninstall some-package-name

例如移除 numpy 包:
pip uninstall numpy

4. 如果要查看已经安装的软件包,可以使用以下命令:
pip list

5. 也可以指定安装包的下载网站(从国内镜像网站安装速度比较快)

pip --default-timeout=1000 install -U   库包名称 -i http://pypi.douban.com/simple/

示例:
pip --default-timeout=1000 install -U numpy  -i http://pypi.douban.com/simple/

 

6. 安装指定版本的软件

pip install some-package-name==version

 

7.  查看已经安装的软件包

pip show some-package-name

 

8. 查看所有可更新的模块
pip list --outdated

9. 更新某一个模块
pip install --upgrade some-package-name

10. 更新所有的模块
pip-review --local --interactive

 

 

国内镜像网站:

清华:https://pypi.tuna.tsinghua.edu.cn/simple

阿里云:http://mirrors.aliyun.com/pypi/simple/

中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/

华中科技大学:http://pypi.hustunique.com/

山东理工大学:http://pypi.sdutlinux.org/

豆瓣:http://pypi.douban.com/simple/

 

常用pip的镜像路径有:

1.阿里云 (经过测试,pip提示版本不正确)

pip install 包名 -i http://mirrors.aliyun.com/pypi/simple/

2.中国科技大学 (经过测试,能用)
pip install 包名 -i https://pypi.mirrors.ustc.edu.cn/simple/

3.豆瓣
pip install 包名 -i http://pypi.douban.com/simple/

4.清华大学  (经过测试,不能用)
pip install 包名 -i https://pypi.tuna.tsinghua.edu.cn/simple/

5..加利福利亚大学
pip install 包名 -i https://www.lfd.uci.edu/~gohlke/pythonlibs/

 

....\Scripts>pip install pytorch-lightning  -i https://pypi.mirrors.ustc.edu.cn/simple/

conda install pytorch-lightning -c conda-forge

conda install -c conda-forge pytorch-forecasting

 

REF

https://www.runoob.com/python3/python3-pip.html



举报

相关推荐

0 条评论