默认情况下 pip 使用的是国外的镜像,在下载的时候速度非常慢,本文我们介绍使用国内清华大学的源,地址为:
https://pypi.tuna.tsinghua.edu.cn/simple
我们可以直接在 pip 命令中使用 -i 参数来指定镜像地址,例如:
pip3 install numpy -i https://pypi.tuna.tsinghua.edu.cn/simple
以上命令使用清华镜像源安装 numpy 包。
这种只对当前安装对命令有用,如果需要全局修改,则需要修改配置文件。
Linux/Mac os 环境中,配置文件位置在 ~/.pip/pip.conf(如果不存在创建该目录和文件):
mkdir ~/.pip
打开配置文件 ~/.pip/pip.conf,修改如下:
[global]index-url = https://pypi.tuna.tsinghua.edu.cn/simple[install]trusted-host = https://pypi.tuna.tsinghua.edu.cn
查看 镜像地址:
$ pip3 config list global.index-url='https://pypi.tuna.tsinghua.edu.cn/simple'install.trusted-host='https://pypi.tuna.tsinghua.edu.cn'
可以看到已经成功修改了镜像。
Windows下,你需要在当前对用户目录下(C:\Users\xx\pip,xx 表示当前使用对用户,比如张三)创建一个 pip.ini在pip.ini文件中输入以下内容:
[global]index-url = https://pypi.tuna.tsinghua.edu.cn/simple[install]trusted-host = pypi.tuna.tsinghua.edu.cn
中国科学技术大学 : https://pypi.mirrors.ustc.edu.cn/simple
豆瓣:http://pypi.douban.com/simple/
c#中string和StringBuilder直接看看执行速度。(2).String类型累计赋值Test  ...
1.全局用户信息设置 git config --global user.name gaojiufeng git config --global user.email 392223903...
Application 对象用于存储和访问来自任意页面的变量,类似 Session 对象。不同之处在于所有的用户分享一个 Application 对象,而 session 对象和用户的关系是一一对应的。很多的书籍中介绍的Application对象都喜欢以统计在线人数来介绍Application 对象...
1.远程仓库的协作模式开发者把自己最新的版本推到线上仓库,同时把线上仓库的最新代码,拉到自己本地即可2.注册git帐号国外: http://www.github.com国内: http://git.oschina.net2.在码云创建项目,不要初始化readmegit push https://gi...
日志查看:git log版本切换:方式1:git reset --hard HEAD^ 倒退一个版本git reset --hard HEAD^^ 倒退两个版本方式2:(版本号的形式,建议版本号码补充完...
public static string GetMD5(string str) { //创建MD5对象 MD5 md5 = MD5.C...