Closed hnisonoff closed 2 years ago
Having the same here ! Any news @hnisonoff ?
I've tried to debug it and for some reason activate-command
is not set after
(activate-command (if (eq system-type 'windows-nt
'("activate")
'("conda" "activate"))))
e.g.:
(message "activate command: %s" activate-command)
yields: activate-command: nil
I've ended up modifying the function conda-env-shell-init
in conda.el
as:
;;;###autoload
(defun conda-env-shell-init (process)
"Activate the current env in a newly opened shell PROCESS."
;; TODO: maintain compatibility with an older Conda version. Do we
;; check the Conda version and cache it?
;; TODO: make sure the shell has been set up for `conda activate`!
;; Do we need to `eval' the conda activation script every time?
(let* ((activate-command (if (eq system-type 'windows-nt
'("activate")
'("conda" "activate"))))
(activate-command (if (not activate-command) '("conda" "activate") activate-command))
(full-command (append activate-command `(,conda-env-current-name "\n")))
(command-string (combine-and-quote-strings full-command)))
(comint-send-string process command-string)
))
Could you submit that as a PR, perhaps?
Louis de Charsonville @.***> writes:
I've tried to debug it and for some reason activate-command is not set after
(activate-command (if (eq system-type 'windows-nt '("activate") '("conda" "activate"))))
e.g.:
(message "activate command: %s" activate-command)
yields: activate-command: nil
I've ended up modifying the function conda-env-shell-init in conda.el as:
;;;###autoload (defun conda-env-shell-init (process) "Activate the current env in a newly opened shell PROCESS." ;; TODO: maintain compatibility with an older Conda version. Do we ;; check the Conda version and cache it? ;; TODO: make sure the shell has been set up for
conda activate
! ;; Do we need toeval' the conda activation script every time? (let* ((activate-command (if (eq system-type 'windows-nt '("activate") '("conda" "activate")))) (activate-command (if (not activate-command) '("conda" "activate") activate-command)) (full-command (append activate-command
(,conda-env-current-name "\n"))) (command-string (combine-and-quote-strings full-command))) (comint-send-string process command-string) ))— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.
-- Rami Chowdhury A mind all logic is like a knife all blade - it makes the hand bleed that uses it. -- Rabindranath Tagore
Hi @necaris, To me your code should work just fine, ie:
((activate-command (if (eq system-type 'windows-nt
'("activate")
'("conda" "activate"))))
I don't understand why it does not.
So I am happy to submit a PR but I feel my solution is more a plaster than anything else and a more appealing solution would fix the let activate-command
part.
UPDATE: understood the issue in above code and submitted a PR to fix it
Ok got the issue, it's was a simple parenthesis problem, I've submitted a PR to fix it: https://github.com/necaris/conda.el/pull/95
Closing as fixed by #95
I am having trouble getting conda.el to work well with my interactive shell (M-x shell). When I run
M-x conda-env-activate <env_name>
and then runM-x shell
I get:<env_name>: command not found
Presumably conda.el is missing the
conda activate
part when initializing the shell, but I'm not sure why?Here is my setup, which is slightly non-standard because my conda home director is in
/anaconda3/
instead of~anaconda3/
.Thanks!