pip install pytest-playwright报zsh: command not found: pip

kaka@KakadeMacBook-Pro PythonLearn % pip install pytest-playwright
zsh: command not found: pip
kaka@KakadeMacBook-Pro PythonLearn % python3
Python 3.11.1 (v3.11.1:a7a450f84a, Dec  6 2022, 15:24:06) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 
KeyboardInterrupt
>>> ^D
kaka@KakadeMacBook-Pro PythonLearn % curl https://bootstrap.pypa.io/pip/get-pip.py -o get-pip.py
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 2509k  100 2509k    0     0   351k      0  0:00:07  0:00:07 --:--:--  546k
kaka@KakadeMacBook-Pro PythonLearn % sudo python3 get-pip.py
Password:
WARNING: The directory '/Users/kaka/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.
Collecting pip
  Downloading pip-22.3.1-py3-none-any.whl (2.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 754.7 kB/s eta 0:00:00
Collecting wheel
  Downloading wheel-0.38.4-py3-none-any.whl (36 kB)
Installing collected packages: wheel, pip
  Attempting uninstall: pip
    Found existing installation: pip 22.3.1
    Uninstalling pip-22.3.1:
      Successfully uninstalled pip-22.3.1
Successfully installed pip-22.3.1 wheel-0.38.4
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
kaka@KakadeMacBook-Pro PythonLearn % pip -V
pip 22.3.1 from /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pip (python 3.11)
kaka@KakadeMacBook-Pro PythonLearn % 

参考文献:

zsh: command not found: pip解决方法

posted @ 2023-01-06 10:04  爱家家的卡卡  阅读(393)  评论(0编辑  收藏  举报