Elpy-config not working
Summary
I am trying to setup Elpy and I can't get Elpy-config to run. I am using MacOS big sur v11.2.3. The output after running (elpy-config) is
Debugger entered--Lisp error: (error "Elpy needs the ’virtualenv’ or ’venv’ python packa...")
signal(error ("Elpy needs the ’virtualenv’ or ’venv’ python packa..."))
error("Elpy needs the ’virtualenv’ or ’venv’ python packa...")
elpy-rpc--create-virtualenv("/Users/pmcvay/.emacs.d/elpy/rpc-venv")
elpy-rpc-get-or-create-virtualenv()
elpy-config--get-config()
elpy-config()
eval((elpy-config) t)
eval-expression((elpy-config) nil nil 127)
funcall-interactively(eval-expression (elpy-config) nil nil 127)
call-interactively(eval-expression nil nil)
command-execute(eval-expression)
I installed pyenv with Homebrew and thus to use pyenv in the shell I had to add a line to my .zshrc file. To use pyenv-mode in emacs successfully I had to add the following line to my init file
(setq exec-path (append exec-path '("/usr/local/opt/pyenv/bin")))
My guess is that this is the reason elpy-config complains about virtualenv not found. What do I need to add to my init file to help elpy find virtualenv?
You can select the python binary used to create the rpc virtualenv with
(setq elpy-rpc-python-command "/path/to/python")
another solution would be to create the virtualenv manually and make elpy-rpc-virtualenv-path points to it.
I hope it helps