[Python]Install packages
keywords: Python, Install pip in Python 3
Install Pip
Check if pip was available:
pip --version
If pip isn’t already installed, then first try to bootstrap it from the standard library:
python -m ensurepip --default-pip
Or install pip independently:
python -m pip install --upgrade pip setuptools wheel
Then add directory Scripts
in environment variables of OS, e.g. D:\Python\Python38-32\Scripts
.
Reference:
https://packaging.python.org/tutorials/installing-packages/#id14
Install numpy
pip install numpy
Issues
ModuleNotFoundError: No module named ‘pip’
Error on executing pip
:
Traceback (most recent call last):
File "d:\sdks\python\python38-32\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "d:\sdks\python\python38-32\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "D:\SDKs\Python\Python38-32\Scripts\pip.exe\__main__.py", line 4, in <module>
ModuleNotFoundError: No module named 'pip'
Solution:
Run:
python -m ensurepip
Or:
py -m ensurepip
he best way to predict your future is to create it. ― Peter Drucker