我使用的是Mac OS 10.15.2(Catalina)。预先安装了Python 2和3.7(/usr/bin/python
,/usr/bin/python3
),并且我已经在brew(/usr/local/bin/python3
)上安装了Python 3.6。另外,我正在使用以下虚拟环境:
virtualenv -p <dir_python> venv
(创建venv)source venv/bin/activate
(激活venv)pip install <package>
(用于安装软件包)当我使用Python 2和3.7创建虚拟环境时,一切正常。 每当我使用Python 3.6时,我都无法安装任何东西。例如,使用“ numpy”,我得到以下信息:
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)': /simple/numpy/
... retrying for four more times ...
Could not fetch URL https://pypi.org/simple/numpy/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/numpy/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)) - skipping
ERROR: Could not find a version that satisfies the requirement numpy (from versions: none)
ERROR: No matching distribution found for numpy
我尝试了其他帖子中的一些内容,这些内容描述了似乎相似的内容,但以下内容均无帮助,例如:
pip install --upgrade pip --trusted-host pypi.org --trusted-host files.pythonhosted.org pip setuptools
非常感谢您的帮助!谢谢。
答案 0 :(得分:2)
我遇到了同样的问题。
要修复它,我刚刚使用brew更新了python。
brew upgrade python3