【问题标题】:Read the Docs: Distutils2 error during installation阅读文档:安装期间出现 Distutils2 错误
【发布时间】:2016-09-28 12:28:09
【问题描述】:

我尝试在我的 Win10 上安装 Read the Docs 的本地实例

当我遵循此文档时:
http://docs.readthedocs.io/en/latest/install.html

然后输入:

pip install -r requirements.txt

我收到此错误:

Collecting Distutils2==1.0a3 (from -r requirements/pip.txt (line 65))
  Using cached Distutils2-1.0a3.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\USER\AppData\Local\Temp\pip-build-xseiavup\Distutils2\setup.py", line 9, in <module>
        from distutils2.util import find_packages
      File "C:\Users\USER\AppData\Local\Temp\pip-build-xseiavup\Distutils2\distutils2\util.py", line 174
        except KeyError, var:
                       ^
    SyntaxError: invalid syntax

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\USER\AppData\Local\Temp\pip-build-xseiavup\Distutils2\

有人知道这个错误吗?

我的点子版本:8.1.2;
蟒蛇:3.5

【问题讨论】:

    标签: python read-the-docs


    【解决方案1】:

    您是否可能正在运行 Python 2 pip?错误消息清楚地表明代码正在 Python 3 下执行,但具有 Python 2 语法。使用

    你会得到更好的结果吗
    python -m pip install -r requirements.txt
    

    我想知道?如果不是,则验证

    python
    

    运行版本 3.5 ...

    哦。我刚查了一下,disutils2 page on PyPI

    Distutils2 开发已停止。

    tl;dr:暂时继续使用 setuptools 和 pip,不要使用 distutils2。

    似乎从来没有 Python 3 版本。看来您可能需要更新代码。

    【讨论】:

    • 谢谢!你有权利。我只是使用 py -2 -m pip install -r requirements.txt 现在它工作正常。非常感谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-05-21
    • 2017-11-05
    • 1970-01-01
    相关资源
    最近更新 更多