Closed notuntoward closed 4 years ago
I think this is because of some recent changes to conda--get-path-prefix. In particular it was made to default to the 'bin' folder even on windows.
On my end I've managed to fix it by overriding the function to use the conda-env-executables-dir
which does list the correct path, and to use quoted paths (just in case there is a space in there somwhere). You can try it out by adding the following to your .emacs somewhere:
(with-eval-after-load 'conda
(defun conda--get-path-prefix (env-dir)
"Get a platform-specific path string to utilize the conda env in ENV-DIR.
It's platform specific in that it uses the platform's native path separator."
(s-trim
(with-output-to-string
(with-current-buffer standard-output
(let* ((conda-executable-path
(concat (file-name-as-directory conda-anaconda-home) (file-name-as-directory conda-env-executables-dir) "conda"))
(command "\"%s\" ..activate \"%s\" \"%s\"")
(formatted-command (format command
conda-executable-path
(if (eq system-type 'windows-nt)
"cmd.exe"
"bash")
env-dir))
(return-code (process-file shell-file-name nil '(t nil) nil shell-command-switch formatted-command)))
(unless (= 0 return-code)
(error (format "Error: executing command \"%s\" produced error code %d" formatted-command return-code)))))))))
I've made a pull request #60 with these changes.
Thanks! I'll give it a try as soon as it ends up on melpa.
@necaris and @Shiandow: This is to confirm that @Shiandow's fix works for me. Anything else needed to get #60 into melpa?
Closed by #60
@notuntoward can you confirm if the latest version on Melpa (which I've confirmed matches the most recent commit to master
) works for you? This should include #60
Yes, it works for me. Thanks.
On my Windows machine, Anaconda has installed conda.exe in:
but since #57, the conda package looks for it in:
Or so it seems, if I look at the error message emacs gives me when I try to activate an environment named "stdso":
Before #57, I think that the conda package looked in my PATH environment variable for a conda.exe, which worked correctly.
I have set both
conda-env-home-directory
andconda-anaconda-home
to: