English 中文(简体)
“pip 配置位置需要 TLS/ SSL, 但是 Python 中的 ssl 模块不可用 ”
原标题:"pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available"

我有Anaconda软件包 运行Spyder。这是我的系统信息:

anaconda                  2018.12                  py37_0

Python                    3.7.1

pip                       18.1

Dell Inspiron 13 7000 64-bit

我无法安装任何来自命令提示的管道 。 我试图安装纳本( 例如,我已经通过 aaconda ) 时会得到以下信息 :

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

Requirement already satisfied: numpy in c:usersuday rallabhandianaconda3libsite-packages (1.15.4)

pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host= pypi.org , port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can t connect to HTTPS URL because the SSL module is not available.")) - skipping

请帮助我理解为什么会发生这种情况。

最佳回答

这是我纠正错误的过程, 在Windows 10和Anaconda:

  1. Added the following paths to my environment variables:
  • /AppData/Local/Continuum/Anaconda3
  • /AppData/Local/Continuum/Anaconda3/Scripts
  • /AppData/Local/Continuum/Anaconda3/Library
  • /AppData/Local/Continuum/Anaconda3/Library/Bin

在目前阶段,错误信息仍然存在。

  1. 我安装了最新版本的pip:

    python -m pip install --upgrade pip
    

这似乎纠正了 DLL 冲突 。

问题回答

我也有同样的问题。我的电脑完全一样, Python和pip的版本也是一样的。

这是与 libeay32.dll 的冲突。

我可以通过在系统环境中添加有libeay32.dll(在我的案例中是C:用户Gabriel Anaconda3pkgsopensl-1.1.1a-he774522_0Libraryin)的 python dir 路径来解决该问题。

当我在Anaconda创造新环境时,我也有同样的问题,激活了它,并试图用管道安装一个图书馆。

conda install pip

然后一切都为我工作

尝试用 pip3 而不是 pip 安装/更新您的安装/更新 。

我也没有 libeay32. dll 在文件夹中, 但是在添加 < code> C: Users< 用户名称 & gt; Anaconda3p kksopensl-1. 1. 1. 1. 1. 1a-he774522_ 0Library_ in 到路径顶端后, 它正在工作。 这是在 Windows 10 64 位上 。

激活您的基础 conda 环境 :

conda 激活基底

将 < strong> "< Path 添加到迷你孔达或 anaconda> Libraryin" 文件夹到 PATH 解决了这个问题 。

Add <Path to miniconda or anaconda>Libraryin folder to PATH or
cd <Path to miniconda or anaconda>Libraryin>

激活基地,然后激活我的决哥环境

(Django_env) (基础) C:vitual_environmentDjango_env> 实际为我工作。

我要在此补充一个不同的答案:

多年来,我们有许多新的python版本(现在直到python3.13),但有些用户仍在使用已终结寿命的“fenter”版本,如fentos-6。

在这些“坚固”的老林努斯/坚固”上,请记住不要安装任何“坚固”的新的 " /坚固 " Python版本,例如,如果试图安装python3.7.x或3.6.14import sl ,即使您已经安装了所有的 ssl deps(libsl/opensl和s dev),您也应该在6.8上安装3.6.6.5 美分。

最后, 升级您的 os 版本的快。

缺少一个查找 Wich 库的注释

$ python -m ssl
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.9/ssl.py", line 99, in <module>
    import _ssl             # if we can t import it, let the error propagate
ImportError: libssl.so.1.1: cannot open shared object file: No such file or directory




相关问题
Can Django models use MySQL functions?

Is there a way to force Django models to pass a field to a MySQL function every time the model data is read or loaded? To clarify what I mean in SQL, I want the Django model to produce something like ...

An enterprise scheduler for python (like quartz)

I am looking for an enterprise tasks scheduler for python, like quartz is for Java. Requirements: Persistent: if the process restarts or the machine restarts, then all the jobs must stay there and ...

How to remove unique, then duplicate dictionaries in a list?

Given the following list that contains some duplicate and some unique dictionaries, what is the best method to remove unique dictionaries first, then reduce the duplicate dictionaries to single ...

What is suggested seed value to use with random.seed()?

Simple enough question: I m using python random module to generate random integers. I want to know what is the suggested value to use with the random.seed() function? Currently I am letting this ...

How can I make the PyDev editor selectively ignore errors?

I m using PyDev under Eclipse to write some Jython code. I ve got numerous instances where I need to do something like this: import com.work.project.component.client.Interface.ISubInterface as ...

How do I profile `paster serve` s startup time?

Python s paster serve app.ini is taking longer than I would like to be ready for the first request. I know how to profile requests with middleware, but how do I profile the initialization time? I ...

Pragmatically adding give-aways/freebies to an online store

Our business currently has an online store and recently we ve been offering free specials to our customers. Right now, we simply display the special and give the buyer a notice stating we will add the ...

Converting Dictionary to List? [duplicate]

I m trying to convert a Python dictionary into a Python list, in order to perform some calculations. #My dictionary dict = {} dict[ Capital ]="London" dict[ Food ]="Fish&Chips" dict[ 2012 ]="...

热门标签