我已经成功安装了flake8:
$ 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)
但它没有出现在/ usr(/ usr / bin /,/ usr / sbin /,/ usr / local / ...)下的任何目录中,即“哪个flake8”没有显示任何内容,所以我不能手动使用控制台来验证说明中的脚本。
答案 0 :(得分:1)
您应该查看~/.local/
已修改的pip(来自Ubuntu的存储库),以防止用户全局安装软件包。您需要查找类似~/.local/bin/flake8
的内容,然后您需要更新shell配置以执行类似
export PATH="~/.local/bin:$PATH"
这样它就会找到你用pip安装的可执行文件。