I'm fairly new to Python virtualenvs and Emacs. I wanted to try and keep the python packages I use for checking and formatting code (flake8 and black) from the packages my actual code base uses (e.g. numpy etc.).
My thought was to create two separate virtualenvs (with pyenv), one for packages needed for Emacs extensions and another for the rest of my code.
I am using the Emacs package elpy; after installing blacken the auto-formatting by black worked right away. Even when I was in my project-venv and black was installed in my emacs-venv.
Flycheck was not so lucky; it has difficulty finding the flake8 executable. Putting the following in my Emacs init file does nothing; it appears to default instead to the python executable in my current virtualenv.
(setq flycheck-python-flake8-executable <PATH>)
I can however get the proper executable by going through the Emacs interactive mode.
M-x flycheck-set-checker-executable RET python-flake8 RET <PATH>
I check the checker status and it says that 'it can be enabled' but when I use the interactive enable command it responds 'checker may not be used in this buffer'.