(1)使用命令:sudo pip install numpy时,可能遇到:
The directory '/Users/huangqizhi/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
说得很清楚,是pip目录的属主不是sudo的root用户。如果必须用sudo pip,更改pip目录属主即可:
sudo chown root /Users/huangqizhi/Library/Caches/pip
sudo chown root /Users/peiyilin/Library/Caches/pip/http
我忘记带不带最后的http了**(我加粗了)
(2)pip安装时,可能遇到:
/Library/Python/2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
解决方法:安装requests,注意后面带[security]:
pip install requests[security]
这一步是先进性,解除requests,再进行安装
网友评论