2016-11-08 118 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