2

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.

hosselausso
  • 967
  • 1
  • 10
  • 28
  • This is not enough information to help you. What operating system are you using? What version of Python, pip, etc.? Where did you get pip from? – Ian Stapleton Cordasco Apr 21 '16 at 21:15
  • Sorry, It's Ubuntu. pip 1.5.4 from /usr/lib/python2.7/dist-packages (python 2.7) – hosselausso Apr 23 '16 at 11:47
  • Related to https://stackoverflow.com/questions/48015106/pip-installed-pylint-cannot-be-found/59064659#59064659 – jdhao Nov 27 '19 at 07:53
  • Possible duplicate of [zsh: command not found: flake8 but flake8 is installed](https://stackoverflow.com/questions/45956359/zsh-command-not-found-flake8-but-flake8-is-installed) – jdhao Nov 27 '19 at 14:02

1 Answers1

7

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.

Ian Stapleton Cordasco
  • 26,944
  • 4
  • 67
  • 72