【问题标题】:curl and run python scriptcurl并运行python脚本
【发布时间】:2014-12-03 14:17:55
【问题描述】:

什么是更短的方法:

wget https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py

?
我试过这个:

sudo <(python <(curl https://bootstrap.pypa.io/get-pip.py))

但它返回错误: 'IOError: [Errno 32] 断管'

这有效:python &lt;(curl https://bootstrap.pypa.io/get-pip.py) 但需要sudo

【问题讨论】:

    标签: bash curl


    【解决方案1】:

    curl https://bootstrap.pypa.io/get-pip.py | sudo python -

    curl 将给定的 URL 输出到标准输出

    python - 表示,该来源将取自标准输入。

    【讨论】:

    • -s curl 的标志(静默)如果您打算在某些自动化脚本或工具中使用它应该会有所帮助,这样它就不会因为下载进度而责备您。
    【解决方案2】:

    另一种安装pip的方式:

    sudo python -m ensurepip

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-04-07
      • 2018-07-23
      • 2014-11-04
      • 1970-01-01
      • 2021-12-19
      • 1970-01-01
      相关资源
      最近更新 更多