requests安装时候报错,zsh: command not found: pip

报错信息:

zsh: command not found: pip

很简单:python3 并不在mac当中叫pip 而是pip3

我们换个命令看看

pip3 install requests

Collecting requests

  Downloading requests-2.32.3-py3-none-any.whl.metadata (4.6 kB)

Collecting charset-normalizer<4,>=2 (from requests)

  Downloading charset_normalizer-3.3.2-cp312-cp312-macosx_10_9_x86_64.whl.metadata (33 kB)

Collecting idna<4,>=2.5 (from requests)

  Downloading idna-3.7-py3-none-any.whl.metadata (9.9 kB)

Collecting urllib3<3,>=1.21.1 (from requests)

  Downloading urllib3-2.2.1-py3-none-any.whl.metadata (6.4 kB)

Collecting certifi>=2017.4.17 (from requests)

  Downloading certifi-2024.6.2-py3-none-any.whl.metadata (2.2 kB)

Downloading requests-2.32.3-py3-none-any.whl (64 kB)

   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 64.9/64.9 kB 385.7 kB/s eta 0:00:00

Downloading certifi-2024.6.2-py3-none-any.whl (164 kB)

   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 164.4/164.4 kB 338.2 kB/s eta 0:00:00

Downloading charset_normalizer-3.3.2-cp312-cp312-macosx_10_9_x86_64.whl (122 kB)

   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 122.2/122.2 kB 86.3 kB/s eta 0:00:00

Downloading idna-3.7-py3-none-any.whl (66 kB)

   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 66.8/66.8 kB 247.5 kB/s eta 0:00:00

Downloading urllib3-2.2.1-py3-none-any.whl (121 kB)

   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 121.1/121.1 kB 853.0 kB/s eta 0:00:00

Installing collected packages: urllib3, idna, charset-normalizer, certifi, requests

Successfully installed certifi-2024.6.2 charset-normalizer-3.3.2 idna-3.7 requests-2.32.3 urllib3-2.2.1

gong@GONGdeMacBook-Air ~ % 

结果很ok,一次到位了,把requests库安装好了。