Closed necaris closed 4 years ago
Context: @notuntoward is experiencing the following error, on Windows,
Error (use-package): conda/:config: Invalid conda environment path
specified: c:/Users/scott/anaconda3/envs/stdso/
when trying to run
(conda-env-activate "stdso")
That error is raised by the conda-env-activate-path
function when the call
(conda-env-is-valid-path "c:/Users/scott/anaconda3/envs/stdso/")
returns nil.
@notuntoward, can you please check that:
conda-env-executables-dir
is "Scripts";c:/Users/scott/anaconda3/envs/stdso/Scripts/python.exe
exists;(concat (expand-file-name "c:/Users/scott/anaconda3/envs/stdso/")
(file-name-as-directory conda-env-executables-dir)
(if (eq system-type 'windows-nt) "python.exe" "python"))
and
(concat (file-name-as-directory (expand-file-name "c:/Users/scott/anaconda3/envs/stdso/"))
(file-name-as-directory conda-env-executables-dir)
(if (eq system-type 'windows-nt) "python.exe" "python"))
and let us know the results?
@arthurcgusmao wrote: can you please check that:
The value of conda-env-executables-dir is "Scripts"; Answer: Yes
The file c:/Users/scott/anaconda3/envs/stdso/Scripts/python.exe exists; Answer: No This must be the problem. python.exe is in: c:/Users/scott/anaconda3/envs/stdso/python.exe
The output of both
output of 1st command: "c:/Users/scott/anaconda3/envs/stdso/Scripts/python.exe"
output of 2nd command: "c:/Users/scott/anaconda3/envs/stdso/Scripts/python.exe"
@notuntoward Yes, probably. That function was introduced in 2dce0ac, but it was only being used by the conda-env-activate-path
function. My refactoring made conda-env-activate
use the former as a subroutine, which revealed the bug.
I have created a fix that should solve the issue.
Can you please give it a try? An easy way to do it is to just evaluate the new file conda.el
and try activating an environment. This fix should also make the package list "base" for Windows systems as a valid option.
@notuntoward thank you for the detailed bug report! I hope that @arthurcgusmao's helpful fix in #71 has solved this -- please let us know if that's not the case!
@arthurcgusmao and @necaris, Thanks -- both problems are fixed.
See https://github.com/necaris/conda.el/issues/47#issuecomment-674576255 from @notuntoward: unable to activate an existing environment using
(conda-env-activate "<name>")
in.emacs
, despite it showing up in the list when runningM-x conda-env-activate
.