-bash: pylint: command not found

11,090

The issue is installed python executables aren't being added to your path. Our paths don't look exactly the same (probably because different python versions, I'm not sure) but mine is

host:~ williamhammond$ pip install pylint
Requirement already satisfied: pylint in /Users/williamhammond/Library/Python/3.7/lib/python/site-packages (2.3.1)
Requirement already satisfied: astroid<3,>=2.2.0 in /Users/williamhammond/Library/Python/3.7/lib/python/site-packages (from pylint) (2.2.5)
Requirement already satisfied: isort<5,>=4.2.5 in /Users/williamhammond/Library/Python/3.7/lib/python/site-packages (from pylint) (4.3.21)
Requirement already satisfied: mccabe<0.7,>=0.6 in /Users/williamhammond/Library/Python/3.7/lib/python/site-packages (from pylint) (0.6.1)
Requirement already satisfied: wrapt in /Users/williamhammond/Library/Python/3.7/lib/python/site-packages (from astroid<3,>=2.2.0->pylint) (1.11.2)
Requirement already satisfied: six in /Users/williamhammond/Library/Python/3.7/lib/python/site-packages (from astroid<3,>=2.2.0->pylint) (1.12.0)
Requirement already satisfied: typed-ast>=1.3.0; implementation_name == "cpython" in /Users/williamhammond/Library/Python/3.7/lib/python/site-packages (from astroid<3,>=2.2.0->pylint) (1.4.0)
Requirement already satisfied: lazy-object-proxy in /Users/williamhammond/Library/Python/3.7/lib/python/site-packages (from astroid<3,>=2.2.0->pylint) (1.4.1)

I was seeing the same issues as you until I looked here

host:~ williamhammond$ ls /Users/williamhammond/Library/Python/3.7/bin/
dmypy           epylint         isort           mypy            pep8            pylint          pyreverse       stubgen         symilar

Once you add this to your path like

export PATH=$PATH:/Users/williamhammond/Library/Python/3.7/bin/

you should be able to use pylint. To make this change permanent make sure to add the command to your ~/.bashrc

Share:
11,090
0xC0DED00D
Author by

0xC0DED00D

Updated on June 01, 2022

Comments

  • 0xC0DED00D
    0xC0DED00D almost 2 years

    I have been trying to install pylint to be used on terminal, but have been unsuccessful in using it. The installation gets successful, but whenever I try to run pylint command, it returns the following error -

    -bash: pylint: command not found
    

    I have tried using following commands -

    pip install pylint
    python -m pip install pylint
    sudo pip install pylint
    sudo -H pip install pylint
    

    I have uninstalled it, before trying each of the above command, but everytime I install it, the installation gets successful, but I am unable to use it on command line. I know it's something silly I am missing.

    Here's the output I get on installation -

    My-Mac:Dev noob$ sudo -H pip install pylint
    Collecting pylint
      Using cached pylint-1.6.5-py2.py3-none-any.whl
    Requirement already satisfied: isort>=4.2.5 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from pylint)
    Requirement already satisfied: six in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from pylint)
    Requirement already satisfied: mccabe in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from pylint)
    Requirement already satisfied: configparser; python_version == "2.7" in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from pylint)
    Requirement already satisfied: backports.functools-lru-cache; python_version == "2.7" in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from pylint)
    Requirement already satisfied: astroid<1.5.0,>=1.4.5 in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from pylint)
    Requirement already satisfied: wrapt in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from astroid<1.5.0,>=1.4.5->pylint)
    Requirement already satisfied: lazy-object-proxy in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from astroid<1.5.0,>=1.4.5->pylint)
    Installing collected packages: pylint
    Successfully installed pylint-1.6.5
    

    PS: I am using macOS Sierra 10.12.3 on a Macbook pro Late 2011, in case this is relevant.