mac使用pip3报错

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mac使用pip3报错相关的知识,希望对你有一定的参考价值。

mac使用pip3报错

ImportError: cannot import name ‘HTTPSHandler‘


解决方法


down vote

It seems your pip requires HTTPSHandler which is part of SSL library.

OSX

On OS X you should link OpenSSL during Python installation (See: #14497).

For Python 2:

brew reinstall python --with-brewed-openssl
pip install --upgrade pip

For Python 3:

brew reinstall python3 --with-brewed-openssl
pip3 install --upgrade pip

You could have multiple Python instances together, to list them run:

brew list | grep ^python

Or list your version via ls -al /usr/local/lib/python*.


参考链接:

https://stackoverflow.com/questions/20688034/importerror-cannot-import-name-httpshandler-using-pip


https://stackoverflow.com/questions/41489439/pip3-installs-inside-virtual-environment-with-python3-6-failing-due-to-ssl-modul


https://stackoverflow.com/questions/20688034/importerror-cannot-import-name-httpshandler-using-pip


pip指定pip源安装:

./obpy17/bin/pip3 install -i http://pypi.douban.com/simple/ django  --trusted-host pypi.douban.com

以上是关于mac使用pip3报错的主要内容,如果未能解决你的问题,请参考以下文章

Mac中 pip3 install mysqlclient 报错

pip3 install scrap报错

Mac环境指定pip3安装文件的存储位置

python安装pymysql【MAC】

Mac上python 在终端使用pip3安装包报ConnectTimeoutError错误

mac使用pip3安装tensorflow(不用conda)