【问题标题】:Pylint issue installation with windows and python 3.2使用 Windows 和 python 3.2 安装 Pylint 问题
【发布时间】:2013-09-16 07:41:24
【问题描述】:

当我尝试使用 pip 在 Windows 上安装 pylint 时遇到了这个问题,我真的不知道它是从哪里来的。

    C:\Python33\Scripts>pip.exe install pylint
    Downloading/unpacking pylint

      Getting page https://pypi.python.org/simple/pylint/
      URLs to search for versions for pylint:
      * https://pypi.python.org/simple/pylint/
      Analyzing links from page https://pypi.python.org/simple/pylint/

    ...

    byte-compiling C:\Python33\Lib\site-packages\pylint\utils.py to utils.cpython-33.pyc

    byte-compiling C:\Python33\Lib\site-packages\pylint\__init__.py to __init__.cpython-33.pyc

    byte-compiling C:\Python33\Lib\site-packages\pylint\__pkginfo__.py to __pkginfo__.cpython-33.pyc

    error: The system cannot find the file specified


    running 2to3 on C:\Python33\Lib\site-packages\pylint\test

    ----------------------------------------

    Cleaning up...

      Removing temporary dir c:\windows\temp\pip_build_abrow198...
    Command C:\Python33\python.exe -c "import setuptools;__file__='c:\\windows\\temp\\pip_build_abrow198\\pylint\\setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\windows\temp\pip-cq0pam-record\install-record.txt --single-version-externally-managed failed with error code 1 in c:\windows\temp\pip_build_abrow198\pylint

【问题讨论】:

  • c:\windows\temp\pip-cq0pam-record\install-record.txt 的内容是否存在?
  • 那里什么都没有,但是我尝试直接使用 tar.gz 文件夹安装,我得到了同样的错误...

标签: python windows pip


【解决方案1】:

Pylint 及其依赖项 logilab-common 的设置脚本中似乎存在错误。使用pip install pylintpython setup.py install 构建时遇到错误。

错误一般是这样的,在.pyc文件被字节编译后发生:

error: The system cannot find the file specified
running 2to3 on C:\Python33\Lib\site-packages\pylint\test

仅仅确保2to3.py 在PATH 上可用似乎还不够; 2to3 本身会运行,但不会安装 Pylint。

我只是花了一点时间试图让这个工作,并找到了两个有希望的建议:

第一个选项,创建一个自定义 bat 文件,以便 2to3 在您的 PATH 上有效(请参阅SO threadissue tracker)。我设法让2to3 在 PowerShell 和 CMD 中作为裸命令运行,但无法安装 Pylint。其他人可能会更幸运。

第二个选项,安装不同版本的 Pylint 和 logilab-common,它们通过 distutils 而不是在命令行调用 2to3(参见 unmerged pull request)。这对我立即起作用。

BitBucket 将自 10 月以来拉取请求列为“开放”。我不知道它什么时候可能会被合并,或者在 PyPI 上更改后多久会生效。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-03-26
    • 1970-01-01
    • 2020-06-18
    • 1970-01-01
    • 2018-08-22
    • 2018-02-24
    • 2012-08-15
    • 1970-01-01
    相关资源
    最近更新 更多