【问题标题】:I am trying to execute pip install fastapi[all] but it is not working我正在尝试执行 pip install fastapi[all] 但它不起作用
【发布时间】:2022-06-11 07:01:46
【问题描述】:

我想通过输入 pip install fastapi[all] 将 Fast API 安装到我的 mac,它出错了。

kanta@Kantas-MacBook-Air fastapi % pip install "fastapi[all]"
zsh: command not found: pip
kanta@Kantas-MacBook-Air fastapi % pip install fastapi[all] 
zsh: no matches found: fastapi[all]
kanta@Kantas-MacBook-Air fastapi % pip install fastapi[all]
zsh: no matches found: fastapi[all]
kanta@Kantas-MacBook-Air fastapi % pip install 'fastapi[all]'
zsh: command not found: pip
kanta@Kantas-MacBook-Air fastapi % 

我认为这是因为我使用的是 mac。有解决办法吗?

【问题讨论】:

标签: api performance


【解决方案1】:

您可以通过-m flag 访问 pip:

-m mod : run library module as a script (terminates option list)
python3 -m pip install "fastapi[all]"

注意:使用 python3 或任何其他别名作为您的版本,例如python3.10.

另外,我可能会建议为您的项目创建 venv。

python3 -m pip install virtualenv
python3 -m virtualenv venv
source venv/bin/activate
pip install "fastapi[all]"

【讨论】:

    【解决方案2】:

    请尝试:

    pip3 install 'fastapi[all]'
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-11-19
      • 2018-04-06
      • 1970-01-01
      • 2019-10-12
      • 2019-11-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多