My pip is broken on Windows, how can I fix it?
Question:
Whenever I try to use pip, using any command I get this:
Traceback (most recent call last):
File "C:Program FilesWindowsAppsPythonSoftwareFoundation.Python.3.8_3.8.1008.0_x64__qzc5n2dfsdra8p0librunpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:Program FilesWindowsAppsPythonSoftwareFoundation.Python.3.8_3.8.1008.0_x64__qzc5n2dfsd8p0librunpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:UsersSEAppDataLocalPackagesPythonSoftwareFoundation.Python.3.8_q3.8_qzc5n2dfsd8p0LocalCachelocal-packagesPython38site-packagespip__main__.py", line 23, in <module>
from pip._internal.cli.main import main as _main # isort:skip # noqa
File "C:UsersSEAppDataLocalPackagesPythonSoftwareFoundation.Python.3.8_qzc5n2dfsd8p0LocalCachelocal-packagesPython38site-packagespip_internalclimain.py", line 10, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "C:UsersSEAppDataLocalPackagesPythonSoftwareFoundation.Python.3.8_qzc5n2dfsd8p0LocalCachelocal-packagesPython38site-packagespip_internalcliautocompletion.py", line 9, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "C:UsersSEAppDataLocalPackagesPythonSoftwareFoundation.Python.3.8_qzc5n2dfsd8p0LocalCachelocal-packagesPython38site-packagespip_internalclimain_parser.py", line 7, in <module>
from pip._internal.cli import cmdoptions
File "C:UsersSEAppDataLocalPackagesPythonSoftwareFoundation.Python.3.8_qzc5n2dfsd8p0LocalCachelocal-packagesPython38site-packagespip_internalclicmdoptions.py", line 24, in <module>
from pip._internal.cli.progress_bars import BAR_TYPES
File "C:UsersSEAppDataLocalPackagesPythonSoftwareFoundation.Python.3.8_qzc5n2dfsd8p0LocalCachelocal-packagesPython38site-packagespip_internalcliprogress_bars.py", line 8, in <module>
from pip._vendor.progress.bar import Bar, FillingCirclesBar, IncrementalBar
ModuleNotFoundError: No module named 'pip._vendor.progress'
PS C:UsersSE> No module named 'pip._vendor.progress'No module named 'pip._vendor.progress'
I am on Windows 10, 64 bit, Python version 3.7.7.
I cannot use pip, how can I fix it?
Answers:
Try doing python -m pip install pytest
. This should install it, and it will make it usable by your IDE.
Hope this helps!
You could follow the equivalent steps mentioned here and here (Both are closed issues on pip’s github page) on your windows machine.
On windows you can do this:
python -m pip uninstall pip setuptools # Sometimes setuptools might be the problem
This will uninstall pip
and setuptools
.
After which you can reinstall them using
python -m ensurepip
This will install pip
and setuptools
.
I have tried this on my windows 10 machine running Python 3.7.4
!
If pip
is broken after an attempted upgrade to a newer version, try the following:
-
Download get-pip.py and "Save As" the file using right-click.
-
Open a command prompt as an administrator
-
cd
to the path where you saved the file, in my case
cd C:UsersxyzDownloads>
then type python get-pip.py
. It will install all required packages, such as wheel
and pip
.
-
To check if it installed correctly, type pip --version
in the command line.
Hope my answer helps someone. Happy coding.
Whenever I try to use pip, using any command I get this:
Traceback (most recent call last):
File "C:Program FilesWindowsAppsPythonSoftwareFoundation.Python.3.8_3.8.1008.0_x64__qzc5n2dfsdra8p0librunpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:Program FilesWindowsAppsPythonSoftwareFoundation.Python.3.8_3.8.1008.0_x64__qzc5n2dfsd8p0librunpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:UsersSEAppDataLocalPackagesPythonSoftwareFoundation.Python.3.8_q3.8_qzc5n2dfsd8p0LocalCachelocal-packagesPython38site-packagespip__main__.py", line 23, in <module>
from pip._internal.cli.main import main as _main # isort:skip # noqa
File "C:UsersSEAppDataLocalPackagesPythonSoftwareFoundation.Python.3.8_qzc5n2dfsd8p0LocalCachelocal-packagesPython38site-packagespip_internalclimain.py", line 10, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "C:UsersSEAppDataLocalPackagesPythonSoftwareFoundation.Python.3.8_qzc5n2dfsd8p0LocalCachelocal-packagesPython38site-packagespip_internalcliautocompletion.py", line 9, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "C:UsersSEAppDataLocalPackagesPythonSoftwareFoundation.Python.3.8_qzc5n2dfsd8p0LocalCachelocal-packagesPython38site-packagespip_internalclimain_parser.py", line 7, in <module>
from pip._internal.cli import cmdoptions
File "C:UsersSEAppDataLocalPackagesPythonSoftwareFoundation.Python.3.8_qzc5n2dfsd8p0LocalCachelocal-packagesPython38site-packagespip_internalclicmdoptions.py", line 24, in <module>
from pip._internal.cli.progress_bars import BAR_TYPES
File "C:UsersSEAppDataLocalPackagesPythonSoftwareFoundation.Python.3.8_qzc5n2dfsd8p0LocalCachelocal-packagesPython38site-packagespip_internalcliprogress_bars.py", line 8, in <module>
from pip._vendor.progress.bar import Bar, FillingCirclesBar, IncrementalBar
ModuleNotFoundError: No module named 'pip._vendor.progress'
PS C:UsersSE> No module named 'pip._vendor.progress'No module named 'pip._vendor.progress'
I am on Windows 10, 64 bit, Python version 3.7.7.
I cannot use pip, how can I fix it?
Try doing python -m pip install pytest
. This should install it, and it will make it usable by your IDE.
Hope this helps!
You could follow the equivalent steps mentioned here and here (Both are closed issues on pip’s github page) on your windows machine.
On windows you can do this:
python -m pip uninstall pip setuptools # Sometimes setuptools might be the problem
This will uninstall pip
and setuptools
.
After which you can reinstall them using
python -m ensurepip
This will install pip
and setuptools
.
I have tried this on my windows 10 machine running Python 3.7.4
!
If pip
is broken after an attempted upgrade to a newer version, try the following:
-
Download get-pip.py and "Save As" the file using right-click.
-
Open a command prompt as an administrator
-
cd
to the path where you saved the file, in my case
cd C:UsersxyzDownloads>
then typepython get-pip.py
. It will install all required packages, such aswheel
andpip
. -
To check if it installed correctly, type
pip --version
in the command line.
Hope my answer helps someone. Happy coding.