Skip to content
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

Exec path is set incorrectly #52

Closed
orausch opened this issue Mar 31, 2020 · 5 comments · Fixed by #55
Closed

Exec path is set incorrectly #52

orausch opened this issue Mar 31, 2020 · 5 comments · Fixed by #55
Labels

Comments

@orausch
Copy link
Contributor

orausch commented Mar 31, 2020

I'm having an issue with the exec-path.

https://github.com/necaris/conda.el/blob/master/conda.el#L184
This function seems to return "" on my system. This results in nil being added to the exec path, and this breaks subsequent conda-env-deactivate calls.

After some debugging, it seems like it fails because the command conda isn't found. I can resolve the issue locally by fully specifying the path of the conda command (i.e. i replace the substring conda with the path of the conda executable)

Any idea why this is happening?

@necaris
Copy link
Owner

necaris commented Apr 1, 2020

@orausch can you tell me a bit more about your system? OS, Emacs version, etc?

@orausch
Copy link
Contributor Author

orausch commented Apr 1, 2020

Sure; my OS is debian testing, my emacs version is 26.1. Conda is installed in a non-standard location: ~/.local/opt/miniconda3, and my conda version is 4.8.2

@necaris necaris added the bug label Apr 9, 2020
@necaris
Copy link
Owner

necaris commented Apr 9, 2020 via email

@seblemaguer
Copy link
Contributor

Hello,

I faced the same problem which seems to be due to the shell activation of conda which is supposed to set some variables. On my side, I replaced conda--get-path-prefix with the following implementation:

(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
       (process-file shell-file-name nil '(t nil) nil shell-command-switch
                     (format "%s/bin/conda ..activate \"%s\" %s"
                             conda-anaconda-home
                             (if (eq system-type 'windows-nt)
                                 "cmd.exe"
                               "bash")
                             env-dir))))))

so it go take the full path of conda based on conda-aconaconda-home

@orausch
Copy link
Contributor Author

orausch commented Apr 10, 2020

@seblemaguer Yes, that seems like a reasonable solution IMO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants