2016-11-08 71 views
0

我使用的是Mac brew安装python和~/.pip/pip.conf如何通过brew安装时在osx上配置pip?

[global] 
index-url=http://mirrors.aliyun.com/pypi/simple 

[install] 
trusted-host=http://mirrors.aliyun.com 

添加一个配置文件,但它不工作。当命令pip install PIL,它抱怨:

Collecting PIL 
    The repository located at mirrors.aliyun.com is not a trusted or secure host and is being ignored. If this repository is available via HTTPS it is recommended to use HTTPS instead, otherwise you may silence this warning and allow it anyways with '--trusted-host mirrors.aliyun.com'. 
    Could not find a version that satisfies the requirement PIL (from versions:) 
No matching distribution found for PIL 

请指教。

+0

皮普开箱的。你是否特别需要使用该存储库? – MisterMiyagi

+0

@MisterMiyagi是的,我想使用该回购。所以你的意思是,添加一个'pip.conf'应该可以工作吗? – Dylan

+0

那么,正如错误所说,配置的工作原理和存储库已知,但不可信。您可以通过“https”进行尝试,也可以使用“--trusted-host mirrors.aliyun.com”选项。 – MisterMiyagi

回答

1

所有你需要做的是标记为值得信赖的这个点子的运行库:当冲泡安装

pip install PIL --trusted-host mirrors.aliyun.com