'venv - pip not found
I am using Windows 10 & Python 3.9
I am new to Python, after I created
venvand 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.exeBut when I use
pip listorpip 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'
Solution 1:[1]
My problem is resolved.
Instead of using
pip install <packages>just need to usepython -m pip install <packages>, withinvenvto avoid the following errorModuleImportError : No module namded pipThese two documents helped to resolve this issue.
Solution 2:[2]
I had to remove virtual environment and create a new one
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Malman |
| Solution 2 | orlov_dumitru |
