pip换源及使用
目录1、pip源2、修改默认源3、其它指令3.1、升级包3.2、查看已经安装的包及版本信息3.3、显示包所在目录及信息4、pip安装1、pip源国内强烈推荐豆瓣的源:http://pypi.douban.com/simple/使用豆瓣源安装方式:pip install -i http://pypi.douban.com/simple/ --trusted-host=pypi.douban.com/
目录
1、pip源
国内强烈推荐豆瓣的源:http://pypi.douban.com/simple/
使用豆瓣源安装方式:
pip install -i http://pypi.douban.com/simple/ --trusted-host=pypi.douban.com/simple ipython
其它源:
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/
其它安装方式(easy_instal):
sudo easy_install -i http://pypi.douban.com/simple/ ipython
2、修改默认源
linux:
1)在用户的家目录下面创建名为.pip文件夹;
2)在创建好的.pip文件夹中创建名为pip.conf的文件;
3)运行命令:vim ~/.pip/pip.conf,写入内容。
cd ~
mkdir .pip
vim ~/.pip/pip.conf
以豆瓣源为例:
[global]
timeout = 6000
index-url = http://pypi.douban.com/simple/
trusted-host = pypi.douban.com
win:
C:用户/当前用户名/AppData/Roaming下,创建文件夹pip,pip下新建文件, pip.ini
[global]
timeout = 6000
index-url = http://pypi.douban.com/simple/
trusted-host = pypi.douban.com
3、其它指令
3.1、升级包
pip install -U packagename
或:pip install --upgrade
3.2、查看已经安装的包及版本信息
pip freeze,查看已经安装的包及版本信息
pip list
查询可升级的包:
pip list -o
3.3、显示包所在目录及信息
pip show
4、pip安装
PIP未安装,解决pip: command not found....
wget https://bootstrap.pypa.io/get-pip.py python get-pip.py
pip -V # 查看pip版本
更新包: pip install -U 包名 pip install --upgrade 包名。
扩展阅读:
1、Python pip 常用命令
更多推荐
所有评论(0)