如何在brew安装时配置osx?

时间:2016-11-08 12:08:28

标签: python macos pip homebrew

我在mac上使用brew安装python并在~/.pip/pip.conf中添加配置文件

[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

请建议。

1 个答案:

答案 0 :(得分:1)

您需要做的就是将存储库标记为此次运行的pip:

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