Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to solve ModuleNotFoundError in Anaconda Prompt

I'm trying to upgrade my pip and other libraries but this error kept appearing. What is this about? I'm thinking that I might be in the wrong directory, but I tried running it on Anaconda directory and still the same error keep showing.

How do I solve this? What directory should I be in?

(base) C:\Users\BINTANG>pip install --upgrade pip
Traceback (most recent call last):
  File "f:\anaconda3\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "f:\anaconda3\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "F:\anaconda3\Scripts\pip.exe\__main__.py", line 4, in <module>
ModuleNotFoundError: No module named 'pip'

EDIT

Tried this already:

enter image description here

like image 823
el-cheapo Avatar asked Nov 17 '25 05:11

el-cheapo


1 Answers

Is this not just a missing path in the PATH Environment Variable? Your OS does not know the pip command: ModuleNotFoundError: No module named 'pip'. Therefore, either add the pip path to your PATH environment variable, or try python -m pip install --upgrade pip instead. If python is in your Environment Variable, it will know pip. See also pip install --upgrade pip vs. python -m pip install --upgrade pip.

If even python is not known, you need to add python to your PATH environment variable or write down the whole filepath/to/the/python.exe instead of just "python".

like image 123
questionto42standswithUkraine Avatar answered Nov 19 '25 20:11

questionto42standswithUkraine