bash: pip: command not found...
1、问题
[root@PC1 test2]# pip install numpy
bash: pip: command not found...
2、系统
[root@PC1 test2]# cat /etc/system-release Rocky Linux release 8.5 (Green Obsidian)
3、python版本
[root@PC1 test2]# python --version Python 3.6.8
4、解决方法
[root@PC1 software]# ls [root@PC1 software]# wget https://bootstrap.pypa.io/pip/3.6/get-pip.py --2022-06-02 13:46:40-- https://bootstrap.pypa.io/pip/3.6/get-pip.py Resolving bootstrap.pypa.io (bootstrap.pypa.io)... 151.101.76.175, 2a04:4e42:12::175 Connecting to bootstrap.pypa.io (bootstrap.pypa.io)|151.101.76.175|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 2159061 (2.1M) [text/x-python] Saving to: ‘get-pip.py’ get-pip.py 100%[==========================================================>] 2.06M 18.8KB/s in 2m 14s 2022-06-02 13:48:56 (15.7 KB/s) - ‘get-pip.py’ saved [2159061/2159061] [root@PC1 software]# ls get-pip.py [root@PC1 software]# python3 get-pip.py Collecting pip<22.0 Downloading pip-21.3.1-py3-none-any.whl (1.7 MB) |████████████████████████████████| 1.7 MB 12 kB/s Collecting wheel Downloading wheel-0.37.1-py2.py3-none-any.whl (35 kB) Installing collected packages: wheel, pip Attempting uninstall: pip Found existing installation: pip 9.0.3 Uninstalling pip-9.0.3: Successfully uninstalled pip-9.0.3 Successfully installed pip-21.3.1 wheel-0.37.1 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv [root@PC1 software]# pip --version pip 21.3.1 from /usr/local/lib/python3.6/site-packages/pip (python 3.6)
5、测试pip命令
[root@PC1 software]# pip install numpy Collecting numpy Downloading numpy-1.19.5-cp36-cp36m-manylinux2010_x86_64.whl (14.8 MB) |████████████████████████████████| 14.8 MB 14 kB/s Installing collected packages: numpy Successfully installed numpy-1.19.5 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv