我在OSX 10.13上的virtualenv中运行pip install
时遇到问题。我已经运行了brew install openssl
,路径/usr/local/include/openssl
指向../opt/openssl/include/openssl
。有人知道怎么解决这个问题吗?这是在我使用brew install
重新安装python
之后开始的。
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. Collecting Pillow Could not fetch URL https://pypi.python.org/simple/pillow/: There was a problem confirming the ssl certificate: Can't connect to HTTPS URL because the SSL module is not available. - skipping Could not find a version that satisfies the requirement Pillow (from versions: ) No matching distribution found for Pillow
更新:以下是更多信息:
✗ which python
/usr/local/opt/python/libexec/bin/python
✗ which pip
/usr/local/opt/python/libexec/bin/pip
✗ python --version
Python 3.7.4
✗ pip --version
pip 19.1.1 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)
✗ brew info python
python: stable 3.7.4 (bottled), HEAD
Interpreted, interactive, object-oriented programming language
https://www.python.org/
/usr/local/Cellar/python/3.6.5_1 (4,795 files, 100.0MB)
Poured from bottle on 2019-10-08 at 14:39:37
/usr/local/Cellar/python/3.7.4_1 (3,903 files, 60.6MB) *
Poured from bottle on 2019-10-08 at 14:37:10
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/python.rb
是的,我已经安装了3.6.5_1和3.7.4_1,因为我有时可能需要在两者之间切换。
✗ brew unlink openssl
Unlinking /usr/local/Cellar/openssl/1.0.2s... 0 symlinks removed
ssl
模块及其底层C扩展似乎是python
公式的一部分:因此,它的丢失很可能意味着
brew reinstall python
应该修复的包安装损坏。还要注意,尽管自制允许多个版本共存,its installation logic isn't quite designed to keep the alternative versions operational,除非它们是通过版本化的公式安装的(例如,常规删除常规
brew cleanup
中的旧版本)。因此,如果需要在Python版本之间进行常规切换,或者需要一些为其提供版本化公式的第三方tap,请考虑使用
pyenv
(也可以通过brew
获得)。相关问题 更多 >
编程相关推荐