-
Notifications
You must be signed in to change notification settings - Fork 261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
with-elpy-rpc-virtualenv-activated
incorrectly alters $PATH
#1713
Comments
Elpy indeed uses the system environment to make its virtualenv. It has been done that way because virtualenvs created with Can I ask why it is a problem for you to have the RPC virtualenv created from the system environment ? |
Thanks for looking into this @galaunay. I do not use my system-wide Python for various reasons (primarily because of the old versions and limited selection of packages that come with it). Instead I use Anaconda (installed in my home directory) and would like elpy to use it too, because then I will have to manage only this one Python installation. Maybe this deviating behavior of elpy with regard to creating RPC environment is worth mentioning in the documentation, because normally |
I definitely agree, I updated the documentation (#1716).
I understand that it is confusing, but I couldn't find a better solution. |
Summary
After
with-elpy-rpc-virtualenv-activated
is run inelpy-rpc--create-virtualenv
, thePATH
environment variable is incorrectly prepended with//bin
. This makeselpy-rpc--create-virtualenv
always use the system-wide Python binary (e.g.,/bin/python
) for creating the RPC virtual environment with virtualenv command.Steps to reproduce
conda init
, so that thePATH
in your shell is always prepended with the path to the Anaconda's Python (e.g.,/home/auser/anaconda3/bin:/home/auser/anaconda3/bin:/home/auser/anaconda3/condabin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
)elpy
from MELPA usingpackage
and configure it as described in the docs./bin
instead of the Anacondas binary.The steps were completed in a freshly installed VM with a fresh install of Anaconda and elpy.
My configuration
OS
Debian 10 buster
Result of
(elpy-config)
Elpy configuration in my init.el
Additional info
I have added several
(message (getenv "PATH"))
towith-elpy-rpc-virtualenv-activated
like this:and that is what is output to the Message buffer when the RPC environment is created:
A workaround for now is to set
elpy-rpc-python-command
ininit.el
to the absolute path of the required Python binary:The text was updated successfully, but these errors were encountered: