【问题标题】:pip install ... does not work: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not availablepip install ... 不起作用:pip 配置了需要 TLS/SSL 的位置,但是 Python 中的 ssl 模块不可用
【发布时间】:2019-10-13 23:34:22
【问题描述】:

我昨天安装了 Anaconda3 (2019)、Python 3.7、Windows 10,现在我无法运行 pip install <package>

当我运行 pip install 时,我收到以下消息:pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

当我尝试安装 ssl 模块时,我收到了相同的错误消息:

D:\>pip install D:\ssl-1.16.tar.gz
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Processing d:\ssl-1.16.tar.gz
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\Alienware\Anaconda3\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Alienware\\AppData\\Local\\Temp\\pip-req-build-fdke_oc7\\setup.py'"'"'; __file__='"'"'C:\\Users\\Alienware\\AppData\\Local\\Temp\\pip-req-build-fdke_oc7\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
         cwd: C:\Users\Alienware\AppData\Local\Temp\pip-req-build-fdke_oc7\
    Complete output (6 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\Alienware\AppData\Local\Temp\pip-req-build-fdke_oc7\setup.py", line 33
        print 'looking for', f
                          ^
    SyntaxError: Missing parentheses in call to 'print'. Did you mean print('looking for', f)?
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
WARNING: 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

pip好像没有安装ssl模块,pip不工作时怎么安装ssl模块?

【问题讨论】:

    标签: python windows pip anaconda


    【解决方案1】:

    运行后解决:

    conda activate base
    

    【讨论】:

      【解决方案2】:

      看来你的包不适合python3,它写的语法是python2的语法。你需要python3的ssl安装包

      【讨论】:

      • 在哪里可以找到它? pip install ssl 似乎只安装了一个 ssl 包。
      • 查看文档发现python3已经自带ssl模块,不需要安装。您可以使用 import ssl 直接导入它
      猜你喜欢
      • 2019-06-21
      • 2021-07-27
      • 1970-01-01
      • 1970-01-01
      • 2021-11-04
      • 2020-10-30
      • 1970-01-01
      • 2023-01-20
      • 2021-07-28
      相关资源
      最近更新 更多