本文介绍了Windows和python 3.2的Pylint问题安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试在带有pip的Windows上安装pylint时遇到了这个问题,我真的不知道它来自哪里.

I got that issue when i try installing pylint on windows with pip, and i really have no idea from where it comes from.

    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

推荐答案

看起来Pylint及其依赖项logilab-common的安装脚本中都有错误.使用pip install pylintpython setup.py install进行构建时遇到错误.

Looks like there's an error in the setup scripts for both Pylint and its dependency logilab-common. I encounter the error when building with pip install pylint or python setup.py install.

错误通常看起来像这样,并且在.pyc文件被字节编译之后立即发生:

The error generally looks like this, and occurs right after .pyc files are byte-compiled:

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

仅确保PATH上的2to3.py可用似乎还不够; 2to3本身可以运行,但是Pylint无法安装.

Simply making sure that 2to3.py is available on PATH doesn't seem to be sufficient; 2to3 itself will run, but Pylint won't install.

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

I just spent a bit trying to get this working, and found two promising suggestions:

第一个选项,创建一个自定义的bat文件,以便2to3有效地位于您的PATH上(请参阅,问题跟踪器).我设法使2to3在PowerShell和CMD中都作为裸命令运行,但是无法安装Pylint.别人可能对此有更多的运气.

First option, create a custom bat file so that 2to3 is effectively on your PATH (see SO thread, issue tracker). I managed to get 2to3 running as a bare command in both PowerShell and CMD, but couldn't get Pylint to install. Someone else might have more luck with this.

第二个选项,安装不同版本的Pylint和logilab-common,它们通过distutils而不是在命令行上调用2to3(请参阅未合并的提取请求).这对我立即起作用.

Second option, install different versions of Pylint and logilab-common which invoke 2to3 through distutils instead of on the command line (see unmerged pull request). This worked immediately for me.

BitBucket自10月起将请求拉为打开"状态.我不知道什么时候可以合并它,或者在PyPI上可以保留多长时间.

BitBucket lists that pull request as "open" since October. I don't know when it might be merged, or how long after that changes might be live on PyPI.

这篇关于Windows和python 3.2的Pylint问题安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-12 00:51