Accidentely uninstalled pip, how to recover?
When I wanted to install a new package in Pycharm, I did accidentely hit the UnInstall button of the pip package. I tried to reinstall it, but now I seem to have a chicken-egg problem. When I select pip and then Install, I do get following error:
Error: Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm Community Edition 2024.3.1.1\plugins\python-ce\helpers\packaging_tool.py", line 85, in run_pip
runpy.run_module(module_name, run_name='__main__', alter_sys=True)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen runpy>", line 222, in run_module
File "<frozen runpy>", line 142, in _get_module_details
ImportError: No module named pip
Then I did run it from the commandline:
D:/<my script folder>/.venv/Scripts/python.exe “C:/Program Files/JetBrains/PyCharm Community Edition 2024.3.1.1/plugins/python-ce/helpers/packaging_tool.py” install pip
Result:
Error: Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm Community Edition 2024.3.1.1\plugins\python-ce\helpers\packaging_tool.py", line 85, in run_pip
runpy.run_module(module_name, run_name='__main__', alter_sys=True)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen runpy>", line 222, in run_module
File "<frozen runpy>", line 142, in _get_module_details
ImportError: No module named pip
So, it is the same error. I did already fully uninstall PyCharm and reinstalled it, but that did also not solve the problem.
Does someone know how can I solve this?
Version information
PyCharm 2024.3.1.1 (Community Edition)
Build #PC-243.22562.220, built on December 18, 2024
Runtime version: 21.0.5+8-b631.28 amd64 (JCEF 122.1.9)
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.awt.windows.WToolkit
Windows 10.0
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 2048M
Cores: 4
Registry:
ide.experimental.ui=true
i18n.locale=
llm.show.ai.promotion.window.on.start=false
请先登录再写评论。
Just try re-creating a virtual environment and it should work fine.