安装 ssl 模块时发现此错误“subprocess-exited-with-error, python setup.py Egg_info did not run success”

问题描述 投票:0回答:1

这是完整的错误:

C:\WINDOWS\system32>pip install ssl
Collecting ssl
  Using cached ssl-1.16.tar.gz (33 kB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [28 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 14, in <module>
        File "C:\Users\WINDOWS\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\__init__.py", line 270, in <module>
          monkey.patch_all()
        File "C:\Users\WINDOWS\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\monkey.py", line 96, in patch_all
          patch_for_msvc_specialized_compiler()
        File "C:\Users\WINDOWS\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\monkey.py", line 156, in patch_for_msvc_specialized_compiler
          patch_func(*msvc14('_get_vc_env'))
                      ^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\WINDOWS\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\monkey.py", line 146, in patch_params
          mod = import_module(mod_name)
                ^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\WINDOWS\AppData\Local\Programs\Python\Python311\Lib\importlib\__init__.py", line 126, in import_module
          return _bootstrap._gcd_import(name[level:], package, level)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\WINDOWS\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\_distutils\_msvccompiler.py", line 20, in <module>
          import unittest.mock as mock
        File "C:\Users\WINDOWS\AppData\Local\Programs\Python\Python311\Lib\unittest\mock.py", line 26, in <module>
          import asyncio
        File "C:\Users\WINDOWS\AppData\Local\Programs\Python\Python311\Lib\asyncio\__init__.py", line 8, in <module>
          from .base_events import *
        File "C:\Users\WINDOWS\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 34, in <module>
          import ssl
        File "C:\Users\WINDOWS\AppData\Local\Temp\pip-install-6t66qbb1\ssl_2992740d127c414fa526766aa7d3f686\ssl\__init__.py", line 140
          except SSLError, x:
                 ^^^^^^^^^^^
      SyntaxError: multiple exception types must be parenthesized
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

我所期待的

我想安装 SSL 模块。

我用的是什么

适用于 Windows 10 x64 的 Python 3.11.5(最新稳定版)

轮0.41.2(最新)

安装工具 68.1.2(最新)

我尝试了什么

来自 Stack Overflow 和 google 的其他类似问题的建议

将Python从3.11.4更新到3.11.5,Wheel和setuptool,但它对我不起作用

python python-module failed-installation python-ssl
1个回答
0
投票

我相信 Pypi 上托管的

ssl
包仅适用于 python 版本 2。

如果您使用的是 python 3,那么

ssl
是标准库的一部分,因此无需安装任何东西,只需安装
import ssl

© www.soinside.com 2019 - 2024. All rights reserved.