Found this error "subprocess-exited-with-error, python egg_info did not run successfully" while installing ssl module

This is the complete error:

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

  × python 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\", line 270, in <module>
        File "C:\Users\WINDOWS\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\", line 96, in patch_all
        File "C:\Users\WINDOWS\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\", line 156, in patch_for_msvc_specialized_compiler
        File "C:\Users\WINDOWS\AppData\Local\Programs\Python\Python311\Lib\site-packages\setuptools\", line 146, in patch_params
          mod = import_module(mod_name)
        File "C:\Users\WINDOWS\AppData\Local\Programs\Python\Python311\Lib\importlib\", 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\", line 20, in <module>
          import unittest.mock as mock
        File "C:\Users\WINDOWS\AppData\Local\Programs\Python\Python311\Lib\unittest\", line 26, in <module>
          import asyncio
        File "C:\Users\WINDOWS\AppData\Local\Programs\Python\Python311\Lib\asyncio\", line 8, in <module>
          from .base_events import *
        File "C:\Users\WINDOWS\AppData\Local\Programs\Python\Python311\Lib\asyncio\", line 34, in <module>
          import ssl
        File "C:\Users\WINDOWS\AppData\Local\Temp\pip-install-6t66qbb1\ssl_2992740d127c414fa526766aa7d3f686\ssl\", 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.

What I was expecting

I want to install the SSL module.

What I was using

Python 3.11.5 for Windows 10 x64 (latest stable)

Wheel 0.41.2 (latest)

Setuptools 68.1.2 (latest)

What I tried

From the suggestion of other similar problems from stack overflow and google

Updated Python from 3.11.4 to 3.11.5, Wheel and setuptool but it didn’t work for me

>Solution :

I believe the ssl package hosted on Pypi is for python version 2 only.

If you are using python 3 then ssl is part of the standard library so there is no need to install anything, just import ssl.

Leave a Reply