我似乎无法找到解决这个问题的方法......
我已经使用以下命令在运行 Python2.7 的 Mac OSX 10.10.5 上安装了 autopep8:
$ pip install autopep8
但是,当我尝试对这样的文件运行任何 autopep8
命令时:
$ autopep8 --in-place --aggressive --aggressive testfile.py
我明白了:
-bash: autopep: command not found
我已尝试确认 autopep8
已通过以下方式安装:
>>> try:
... import autopep8
... print "this is installed"
... except ImportError:
... print "no module"
...
this is installed
我还卸载并重新安装了 autopep8
和 pep8
几次,但无济于事。我还应该尝试什么或我做错了什么?
最佳答案
你必须修复你的 ~/.bashrc
:
export PATH=/full/path/to/autopep8_executable/dir:$PATH
然后:
exec bash
重新加载编辑后的文件
你可以找出目录在哪里使用:
find ~ -name autopep8
关于python - -bash 命令在尝试运行 autopep8 时未发现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34538311/