2017-06-28 2 views
3

Wenn ich eine Python-Datei in Emacs öffnen ich folgende Fehlermeldung:Flymake Konfigurationsfehler während Python-Datei öffnen, aber richtig Setup Flocke

Flymake: Konfigurationsfehler aufgetreten beim Laufen (flake8> .. ../xyz_flymake.py). Flymake wird ausgeschaltet.

Aber auf der anderen Seite ist es ich alle Module für elpy richtig funktioniert erforderlich konfiguriert haben scheint:

Elpy Configuration 

Virtualenv........: None 
RPC Python........: 3.5.3 (/usr/bin/python3.5) 
Interactive Python: /usr/bin/python3.5 (/usr/bin/python3.5) 
Emacs.............: 24.5.1 
Elpy..............: 1.10.0 
Jedi..............: 0.10.2 
Rope..............: 0.10.5 
Importmagic.......: 0.1.7 
Autopep8..........: 0.1.7 
Syntax checker....: flake8 (/usr/local/bin/flake8) 

You have not activated a virtual env. While Elpy supports this, it is 
often a good idea to work inside a virtual env. You can use M-x 
pyvenv-activate or M-x pyvenv-workon to activate a virtual env. 

The directory ~/.local/bin/ is not in your PATH. As there is no active 
virtualenv, installing Python packages locally will place executables 
in that directory, so Emacs won't find them. If you are missing some 
commands, do add this directory to your PATH. 

Options 

`Raised' text indicates buttons; type RET or click mouse-1 on a button 
to invoke its action. Invoke [+] to expand a group, and [-] to 
collapse an expanded group. Invoke the [Group], [Face], and [Option] 
buttons below to edit that item in another window. 

Wie kann ich dieses Problem beheben?

Antwort

1

Es ist unklar, was der Konfigurationsfehler ist. Es ist möglich, dass Sie auf eines der vielen Probleme stoßen.

  1. Sie scheinen Python zu wollen 3.5 verwenden, aber es gibt keinen klaren Indikatoren für welche Version von Python Flake8 läuft. Es könnte sein, dass elpy einen Konflikt erkennt und es ablehnt, Flake8 zu verwenden, wenn es Ihnen keine nützlichen Informationen liefert. (Flake8 muss auf der gleichen Python-Version installiert sein, dass der Code laufen soll weiter.)

  2. Elpy scheint darauf, dass Sie einen virtualenv verwenden oder dass Sie ~/.local/bin/ zu Ihrem PATH hinzufügen. Ich würde empfehlen, beides zu tun.

    Sie können ein virtualenv erstellen, indem Sie virtualenv ~/.elpy-venv tun und es mit source ~/.elpy-venv/bin/activate aktivieren.

    Sie können Ihre Shell-Konfigurationsdatei (zum Beispiel ~/.bashrc, ~/.bash_profile, ~/.zshrc, etc.) bearbeiten export PATH="$PATH:~/.local/bin" zu tun.