No Module Named 'Symbol'

Question:

I have problem with my pip . Lately I was getting error when I was trying to install any packages The Error was: ( Pyautogui )

Traceback (most recent call last):
  File "C:Usersrati_OneDriveDesktopPyAutoGUI-0.9.53.tarPyAutoGUI-0.9.53PyAutoGUI-0.9.53setup.py", line 4, in <module>
    from setuptools import setup
  File "C:Usersrati_AppDataLocalProgramsPythonPython310libsite-packagessetuptools__init__.py", line 12, in <module>
    from setuptools.extension import Extension
  File "C:Usersrati_AppDataLocalProgramsPythonPython310libsite-packagessetuptoolsextension.py", line 7, in <module>
    from setuptools.dist import _get_unpatched
  File "C:Usersrati_AppDataLocalProgramsPythonPython310libsite-packagessetuptoolsdist.py", line 16, in <module>
    import pkg_resources
  File "C:Usersrati_AppDataLocalProgramsPythonPython310libsite-packagespkg_resources.py", line 29, in <module>
    import symbol
ModuleNotFoundError: No module named 'symbol'

I reinstalled pip , python but couldn’t fix the error …
There was no information online so I couldn’t fix it.
Any Tips?

Asked By: R.A

||

Answers:

Module symbol was a part of the standard library since the dawn of time. It was declared deprecated in Python 3.9 and finally removed in 3.10. For Python 3.10 one has to upgrade any 3rd-party library that imports symbol. In your case the libraries are pip/setuptools:

pip install --upgrade pip setuptools

If upgrade is not possible or there is no newer version of libraries updated for Python 3.10 the only solution is to downgrade Python.

Answered By: phd

I just reinstalled pip3 with the (official?) pip installer. Since then it worked again.

Answered By: Lampe2020
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.