Reputation: 69
I am using Windows 10 & Python 3.9
I am new to Python, after I created venv
and facing the following errors:
My venv is able to catch the pip path when I use the command where pip
. Which is in F drive
(venv) F:\Documents\venv\MachineLearning\venv> where pip
F:\Documents\venv\MachineLearning\venv\Scripts\pip.exe
C:\Users\MALARMANNAN R\AppData\Local\Programs\Python\Python39\Scripts\pip.exe
F:\Additional softwares\python\Python\Scripts\pip.exe
But when I use pip list
or pip install <package_name>
, I am getting error : ModuleNotFoundError: No module named 'pip'
(venv) F:\Documents\venv\MachineLearning\venv>pip list
Traceback (most recent call last):
File "C:\Users\MALARMANNAN R\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\MALARMANNAN R\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "F:\Documents\venv\MachineLearning\venv\Scripts\pip.exe\__main__.py", line 4, in <module>
ModuleNotFoundError: No module named 'pip'
Upvotes: 2
Views: 6983
Reputation: 69
My problem is resolved.
Instead of using pip install <packages>
just need to use python -m pip install <packages>
, within venv
to avoid the following error
ModuleImportError : No module namded pip
These two documents helped to resolve this issue.
Upvotes: 4