No luck pip-installing pylint for Python 3

烂漫一生 提交于 2019-12-04 05:47:01
Yuval Adam

Yes, pylint versions > 0.23.0 do support Py3K.

Your issue seems to be described in http://www.logilab.org/82417 (also Getting started with Pylint for Jython (jython2.5.1))

The cached ticket page recommends running:

$ NO_SETUPTOOLS=1 python3.2 setup.py install --no-compile
$ easy_install-3.2 logilab-common
$ easy_install-3.2 logilab-astng
# You can probably use pip instead of easy_install...

I've managed to get pylint running in Python3 on Linux (Ubuntu12.04, though I don't think the version matters in the following) after a bit of a struggle. I'm not exactly sure what I did wrong along the line, but various files were in the wrong place or had the wrong access mode and all normal procedures failed. [Attempts to install pylint via apt-get and pip certainly contributed to the mess.] I think the following sequence was what got everything unscrewed again. In case it helps someone else (no guarantees) here's what I just did:

  1. Make sure that /usr/bin/python is a symbolic link to /usr/bin/python3.2 not /usr/bin/python2.7 [edit I subsequently had trouble with various Python2 scripts failing as a result of this, so you may want to reset it to python2 after getting pylint installed.]
  2. sudo vi /usr/local/lib/python3.2/dist-packages/easy-install.pth and delete any references to pylint and logilab eggs. [There shouldn't be any if you've just started.]
  3. Download pylint from http://pypi.python.org/pypi/pylint/0.26.0. Unzip etc.
  4. cd into the unzipped pylint directory and type the command 'sudo python3 setup.py install'

At that stage the command 'pylint' worked but only for the superuser. Some files weren't world readable. The following two command sorted them out:

  1. sudo chmod a+rx /usr/local/bin/pylint
  2. sudo chmod a+rX -R /usr/local/lib/python3.2

Good luck!

EDIT: I just went through the install process on another Linux box in a clean state, and apart from having also to install the two dependencies (logilab-common and logilab-astng) in exactly the same way as pylint above, it all went well. So it looks as though the problems arose through installing a version for Python 2 first and possibly through the use of pip.

arhuaco

For Ubuntu 14.04:

sudo aptitude install python3-pip
sudo pip3 install pylint
/usr/local/bin/pylint your_file.py
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!