Search code examples
flake8

flake8 module installed but not un /usr/bin


I have installed flake8 successfully:

$ pip install flake8
Downloading/unpacking flake8
  Downloading flake8-2.5.4-py2.py3-none-any.whl
Downloading/unpacking mccabe<0.5,>=0.2.1 (from flake8)
  Downloading mccabe-0.4.0-py2.py3-none-any.whl
Downloading/unpacking pep8!=1.6.0,!=1.6.1,!=1.6.2,>=1.5.7 (from flake8)
  Downloading pep8-1.7.0-py2.py3-none-any.whl (41kB): 41kB downloaded
Downloading/unpacking pyflakes<1.1,>=0.8.1 (from flake8)
  Downloading pyflakes-1.0.0-py2.py3-none-any.whl (152kB): 152kB downloaded
Installing collected packages: flake8, mccabe, pep8, pyflakes
Successfully installed flake8 mccabe pep8 pyflakes
Cleaning up...

$ pip list|grep flake
flake8 (2.5.4)
pyflakes (1.0.0)

But it doesn't appear in any of the directories under /usr (/usr/bin/, /usr/sbin/, /usr/local/...) i.e. "which flake8" doesn't show anything, so I can't use from the console manually to verify a script like in the instructions.


Solution

  • You should look in ~/.local/ the pip you have installed (from Ubuntu's repositories) is modified to prevent the user from installing packages globally. You'll need to look for something like ~/.local/bin/flake8 and then you'll want to update your shell config to do something like

    export PATH="~/.local/bin:$PATH"
    

    So that it finds the executables you install with pip.