Python-pip常用命令

Python-pip常用命令

显示版本和路径

pip --version

获取帮助

pip --version

升级pip

pip install -U pip
pip install --upgrade pip

安装包

pip install SomePackage                # 最小版本
pip install SomePackage==1.0.4         # 指定版本

升级包

pip install --upgrade SomePackage

卸载包

pip uninstall SomePackage

显示安装包信息

pip show

列出已安装的包

pip list

查看可升级的包

pip list -o

常见问题

1.提示no module name pip
解决方法:输入

pip -m ensurepip;
easy_install pip

2.更改pip源
可以在使用pip的时候,加上参数-i和镜像地址(如
https://pypi.tuna.tsinghua.edu.cn/simple),
例如:pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pandas,这样就会从清华镜像安装pandas库。

(1)阿里云 http://mirrors.aliyun.com/pypi/simple/
(2)豆瓣http://pypi.douban.com/simple/
(3)清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
(4)中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/
(5)华中科技大学http://pypi.hustunique.com/

发布了33 篇原创文章 · 获赞 1 · 访问量 2305

猜你喜欢

转载自blog.csdn.net/qq_40805620/article/details/95527106
今日推荐