Flymake config error when opening python file, but configure flake correctly

When I open the python file in emacs I get the following error message:

Flymake: A configuration error occurred while running (flake8> .... / xyz_flymake.py). Flymake will be disabled.

But on the other hand, it looks like I configured all the modules required for elpy to work properly:

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.

      

How can I solve this problem?

+3


source to share


1 answer


It is not clear what the configuration error is. You may be facing one of the many problems.



  • You seem to want to use Python 3.5, but there is no clear indicator of which version of Python Flake8 is running. It's possible that elpy detects a mismatch and refuses to use Flake8 when it doesn't provide you with any useful information. (Flake8 must be installed in the same Python version the code is supposed to run on.)

  • Elpy seems to insist that you are using virtualenv or adding ~/.local/bin/

    to PATH

    . I would suggest doing both.

    You can create a virtualenv by executing virtualenv ~/.elpy-venv

    and activating it with source ~/.elpy-venv/bin/activate

    .

    You can change the configuration file Shell (eg ~/.bashrc

    , ~/.bash_profile

    , ~/.zshrc

    etc.) to perform export PATH="$PATH:~/.local/bin"

    .

+1


source







All Articles