【问题标题】:Installing from Github using pip使用 pip 从 Github 安装
【发布时间】:2016-10-20 17:07:43
【问题描述】:

我试过这个pip install

pip install https://github.com/rapptz/discord.py

我收到错误“SyntaxError: Invalid Syntax”。

我可以使用 pip 从 GitHub 安装吗?

【问题讨论】:

  • 人们告诉我这是他们见过的最大错误
  • 这个错误非常严重
  • Pip 不适用于直接从 GitHub 存储库安装。它从 Python 模块目录安装 Python 模块。 (我从未使用过 Python,但我对它的了解足以知道这是错误的方法。)

标签: github installation pip


【解决方案1】:

这个包似乎只适用于 python 3.x。所以只需输入以下命令:

sudo python3 -m pip install git+https://github.com/rapptz/discord.py

这个命令的含义:

  1. python3 -m是指定python版本。
  2. pip install git+https:[URL] 用于 git repos。
  3. 请注意,第 2 点也可以是:pip install git+git:[URL]pip install --upgrade https:[URL]

【讨论】:

    【解决方案2】:

    pip 是 Python 之外的命令行实用程序。

    在您的终端上运行 pip install https://github.com/rapptz/discord.py,而不是在 python REPL 中。

    【讨论】:

    • 在哪里可以找到终端
    • 你用的是什么操作系统?
    • 如果您还没有 pip,请look here 了解如何安装它的说明。安装后,open the command prompt 并运行pip install https://github.com/rapptz/discord.py
    • 另外,请查看这个问题:stackoverflow.com/questions/20101834/…,了解有关使用pip 克隆 git 存储库的更多信息
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多