Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
29
rated 0 times [  29] [ 0]  / answers: 1 / hits: 62849  / 3 Years ago, mon, june 28, 2021, 1:31:07

My understanding is that the latest release of Pylint (1.0.0 at the time of this writing) has support for Python 3, but I can't get it to work on 64-bit Ubuntu 13.04 with Python 3.3.



I followed the installation instructions on the PyPi site, and Pylint 1.0.0 seems to be installed successfully (pylint --version returns pylint 1.0.0), and works with Python 2.7 code, but it reports a syntax error when it sees nonlocal statements and such.



What gives? Are there special installation instructions for Pylint on Ubuntu?


More From » python

 Answers
6

Python 2 and 3 are separate beasts. If you install a script into the site-packages of one version, you are not installing it into the other.



I'd install it through pip, but you'll need the right version of pip.



sudo apt-get install python3-pip
sudo pip-3.3 install pylint


This will replace your 2.7 version. We can confirm this by checking less $(which pylint):



#!/usr/bin/python3.3
# EASY-INSTALL-ENTRY-SCRIPT: 'pylint==1.0.0','console_scripts','pylint'
__requires__ = 'pylint==1.0.0'
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
sys.exit(
load_entry_point('pylint==1.0.0', 'console_scripts', 'pylint')()
)

[#29623] Tuesday, June 29, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ncharm

Total Points: 255
Total Questions: 105
Total Answers: 118

Location: Virgin Islands (U.S.)
Member since Sat, May 6, 2023
1 Year ago
ncharm questions
;