Frozen runpy error while running pip on cmd

C:\WINDOWS\system32>pip --version
Traceback (most recent call last):
File “”, line 198, in _run_module_as_main
File “”, line 88, in run_code
File "C:\Users\user pc\AppData\Roaming\Python\Python311\Scripts\pip.exe_main
.py", line 4, in
File “C:\Python311\Lib\site-packages\pip_internal\cli\”, line 10, in
from pip._internal.cli.autocompletion import autocomplete
File “C:\Python311\Lib\site-packages\pip_internal\cli\”, line 10, in
from pip._internal.cli.main_parser import create_main_parser
File “C:\Python311\Lib\site-packages\pip_internal\cli\”, line 9, in
from pip._internal.build_env import get_runnable_pip
File “C:\Python311\Lib\site-packages\pip_internal\”, line 19, in
from pip._internal.cli.spinners import open_spinner
File “C:\Python311\Lib\site-packages\pip_internal\cli\”, line 9, in
from pip._internal.utils.logging import get_indentation
File “C:\Python311\Lib\site-packages\pip_internal\utils\”, line 29, in
from pip.internal.utils.misc import ensure_dir
File “C:\Python311\Lib\site-packages\pip_internal\utils\”, line 37, in
from pip.vendor.tenacity import retry, stop_after_delay, wait_fixed
File "C:\Python311\Lib\site-packages\pip_vendor\tenacity_init
.py", line 27, in
from concurrent import futures
File "C:\Python311\Lib\site-packages\concurrent\futures_init
.py", line 8, in
from concurrent.futures._base import (FIRST_COMPLETED,
File “C:\Python311\Lib\site-packages\concurrent\”, line 357
raise type(self._exception), self._exception, self._traceback
SyntaxError: invalid syntax

I tried to uninstall and then install Python to the latest version, still gives the same error. I tried to upgrade pip still gives the same error. I tried to downgrade Python still gives the same error. I tried to install and uninstall modules by using pip in the command prompt still gives the same error. I even updated the environment path still gives the same error. What is the solution for these errors? Please help it is urgent.
Preformatted text

It looks like you have multiple Python’s installed:

  • C:\Users\user pc\AppData\Roaming\Python\Python311\
  • C:\Python311

Try uninstalling both.

Do you set any environment variables like PYTHONPATH? Try removing all of them.

Additionally it looks like a futures backport for Python 2 was installed on Python 3 which leads to the syntax error if PYTHONPATH is used wrong.

Thank you so much it worked. :+1:
I removed the Python path and uninstalled the multiple Python. Then installed freshly python again and that path I added to environment variables.

The same thing happened to me. I have two installations, one from the Windows App Store and another from .org. To resolve the issue, I had to follow these steps:

  1. Go to the uninstall panel and remove both installations of pip.
  2. Re-install a lower version of pip.

However, I still ended up with two pip installations (one old and one new), so when I ran -pip, nothing happened. To confirm this, I checked via ‘where pip’ on Bash and found two instances. Consequently, I removed the entire old folder.

Now it works perfectly