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
Provide a working configuration for windows and anaconda users #1731
Comments
I'm having trouble with the switch to a dedicated virtualenv as well, though I'm running Elpy on Linux. Let me know if I should open a separate issue. SummaryElpy fails to create its own venv when Python is provided by a conda env and system Python is of different version. DetailsThis happens on a compute cluster where I do not have root access. Since the Python provided by the admins is ancient, I use a conda env at My elisp is not the best, but as far as I understand, Elpy calls WorkaroundA workaround was to ConfigurationOSCustom Linux Elpy ConfigurationRun after completing the workaround since it didn't work before that.
|
The trick is here: (defun elpy-rpc--create-virtualenv (rpc-venv-path)
"Create a virtualenv for the RPC in RPC-VENV-PATH."
;; venv cannot create a proper virtualenv from inside another virtualenv
(let* ((elpy-rpc-virtualenv-path 'global) ;;<==== HERE
success
(elpy-venv-buffname-visible "*elpy-virtualenv*")
(elpy-venv-buffname (concat " " elpy-venv-buffname-visible)))
...
The thing that is creating you problem is that Elpy determines which environment is the "global" one by getting the last python interpreter in PATH (in your case the old python2 one I presume). I admit that it is not optimal, but I couldn't find a better definition of what would be a "global" environment... Any idea is welcome on that matter. A solution that could work in your case would be to create your own virtualenv for the RPC (let's say in |
Ok, I see. I thought that there was something I'd missed :-). Thanks for taking the time to explain, really appreciate that. |
The switch to a dedicated virtualenv for the RPC has made Elpy difficult to configure on windows, specially with anaconda (from user feedbacks and personal tests).
Preferably, we would need to make Elpy work out-of-the-box for windows and anaconda.
If not possible, the minimum is to provide working configuration examples.
The text was updated successfully, but these errors were encountered: