python 和 pip:陷入无限的非安装循环
python and pip: stuck in an endless non-install loop
这些天我 运行 自己在 python 安装的圈子里,但我不确定为什么。我的直觉告诉我我正在将我的包安装在 python 的某个版本中,当我访问它们时找不到它们,因为路径错误。我正在使用 venv,python 3.6.5,MacOS。我尝试安装的所有东西都会得到:
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
对于我尝试和安装的所有内容。我搜索了这个并尝试修复
pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org <<whateverpackage>>
没有骰子。我可以让 conda 为安装工作,但是当我尝试在 python 中初始化时,我找不到模块。这让我觉得正在发生的事情是这些工具安装在不同的路径中。 python 结果:
$ which python
/Users/myname/.pyenv/shims/python
当我要求安装软件包时,我也得到了不同的结果:
pip list
DEPRECATION: The default format will switch to columns in the future. You can use --format=. (legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
pip (9.0.3)
setuptools (39.0.1)
经文
conda list
# packages in environment at /anaconda3:
#
# Name Version Build Channel
anaconda-client 1.7.2 py37_0
anaconda-navigator 1.9.12 py37_0
beautifulsoup4 4.9.1 py37_0
还有运行:
$ brew update && brew upgrade
没有变化。我快要发疯了,想弄清楚我在哪里丢失了线程。这感觉像是 venv 自己造成的问题,但此时我安装的所有软件包似乎都可以在 conda 中运行,但在 pip 中失败,并且当我在命令行访问 python 时都不起作用。
另外,不确定这是否有帮助:我在 conda 中启动了一个虚拟环境,同样的问题。我的路径:
$echo $PATH
/Users/username/.pyenv/shims:/Users/username/.pyenv/shims:/usr/local/Cellar/pyenv-virtualenv/1.1.5/shims:/Users/username/.pyenv/shims:/anaconda3/envs/venv/bin:/Users/username/miniconda3/bin:/Users/username/miniconda2/bin:/Users/username/anaconda3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/username/Downloads/chromedriver:/opt/X11/bin
和
$echo $PYTHONPATH
没有返回任何内容。
建议?
感谢@KlausD 为我指明了正确的方向。最终的结果是我们缺少 ssl。我发现 this post 建议我可以从 运行 新的 brew 安装 ssl 中获益。
我运行:
brew switch openssl 1.0.2t
就是这样,之后一切正常!我用头撞墙三天了,我们到了....
openssl/pyopenssl/python/pip
版本匹配也是我的问题。我最终进入了 https://www.pyopenssl.org/en/stable/install.html 页面并使用了
python -m OpenSSL.debug
找出 pyOpenSSL、密码学和链接的 OpenSSL 的版本。
这些天我 运行 自己在 python 安装的圈子里,但我不确定为什么。我的直觉告诉我我正在将我的包安装在 python 的某个版本中,当我访问它们时找不到它们,因为路径错误。我正在使用 venv,python 3.6.5,MacOS。我尝试安装的所有东西都会得到:
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
对于我尝试和安装的所有内容。我搜索了这个并尝试修复
pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org <<whateverpackage>>
没有骰子。我可以让 conda 为安装工作,但是当我尝试在 python 中初始化时,我找不到模块。这让我觉得正在发生的事情是这些工具安装在不同的路径中。 python 结果:
$ which python
/Users/myname/.pyenv/shims/python
当我要求安装软件包时,我也得到了不同的结果:
pip list
DEPRECATION: The default format will switch to columns in the future. You can use --format=. (legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
pip (9.0.3)
setuptools (39.0.1)
经文
conda list
# packages in environment at /anaconda3:
#
# Name Version Build Channel
anaconda-client 1.7.2 py37_0
anaconda-navigator 1.9.12 py37_0
beautifulsoup4 4.9.1 py37_0
还有运行:
$ brew update && brew upgrade
没有变化。我快要发疯了,想弄清楚我在哪里丢失了线程。这感觉像是 venv 自己造成的问题,但此时我安装的所有软件包似乎都可以在 conda 中运行,但在 pip 中失败,并且当我在命令行访问 python 时都不起作用。
另外,不确定这是否有帮助:我在 conda 中启动了一个虚拟环境,同样的问题。我的路径:
$echo $PATH
/Users/username/.pyenv/shims:/Users/username/.pyenv/shims:/usr/local/Cellar/pyenv-virtualenv/1.1.5/shims:/Users/username/.pyenv/shims:/anaconda3/envs/venv/bin:/Users/username/miniconda3/bin:/Users/username/miniconda2/bin:/Users/username/anaconda3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/username/Downloads/chromedriver:/opt/X11/bin
和
$echo $PYTHONPATH
没有返回任何内容。
建议?
感谢@KlausD 为我指明了正确的方向。最终的结果是我们缺少 ssl。我发现 this post 建议我可以从 运行 新的 brew 安装 ssl 中获益。
我运行:
brew switch openssl 1.0.2t
就是这样,之后一切正常!我用头撞墙三天了,我们到了....
openssl/pyopenssl/python/pip
版本匹配也是我的问题。我最终进入了 https://www.pyopenssl.org/en/stable/install.html 页面并使用了
python -m OpenSSL.debug
找出 pyOpenSSL、密码学和链接的 OpenSSL 的版本。