赞
踩
可以在使用pip的时候加参数-i 镜像地址
新版ubuntu要求使用https源。
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pandas
python -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --upgrade pip
这样就会从清华这边的镜像去安装pandas库。
修改 ~/.pip/pip.conf
(Linux系统,没有就创建一个文件夹及文件)
[global]
timeout = 60000
index-url = http://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com
1、WIN+R,然后输入%APPDATA%
,会定位到一个新的目录下,我的是
C:\Users\Administrator\AppData\Roaming
2、在该目录下新建pip文件夹
3、然后到pip文件夹里面去新建个pip.ini文件
4、然后打开该文件,将以下内容写入进去
[global]
timeout = 6000
index-url = http://pypi.douban.com/simple
[install]
trusted-host = pypi.douban.com
conda
conda config --show-sources
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes
File >Settings > Project: [项目名] > Project Interpreter > [右边加号]
> Manager Repositories > [右边加号] > 输入 http://mirrors.aliyun.com/pypi/simple/
python中通过requirements.txt
来记录项目所有的依赖包及其版本号,以便在其他的环境中部署
python -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --upgrade pip
pip freeze > requirements.txt
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt
机构 | 镜像地址 |
---|---|
阿里云 | http://mirrors.aliyun.com/pypi/simple/ |
豆瓣 | http://pypi.douban.com/simple/ |
清华 | https://pypi.tuna.tsinghua.edu.cn/simple |
中国科技大学 | https://pypi.mirrors.ustc.edu.cn/simple/ |
华中理工大学 | http://pypi.hustunique.com/ |
山东理工大学 | http://pypi.sdutlinux.org/ |
import sys
sys.executable
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。