necaris / conda.el

Emacs helper library (and minor mode) to work with conda environments
MIT License
154 stars 51 forks source link

`conda-env-subdirectory` docstring references `conda-anaconda-home` instead of `conda-env-home-directory` #51

Closed dfeich closed 4 years ago

dfeich commented 4 years ago

This is a small error which may be responsible for users not managing to configure conda.el.

I have an anaconda configuration with

This requires

(setq conda-anaconda-home "/opt/anaconda/python3.6"
        conda-env-home-directory "/opt/anaconda"
        conda-env-subdirectory "myenvs"))

Since the docstring of conda-env-subdirectory suggests that the dirname will be added to conda-anaconda-home, some people who do not look at the src code may fail to understand that they need to configure it. They will leave it at the default "envs" value. Maybe #45 has this problem, but he does not provide enough information on his specific settings.

necaris commented 4 years ago

Thank you for spotting this @dfeich ! I think I've addressed it in 814439d :-)

YunEr-Wang commented 4 years ago

This is a small error which may be responsible for users not managing to configure conda.el.

I have an anaconda configuration with

  • anaconda installation: /opt/anaconda/python3.6
  • virtual env directory: /opt/anaconda/myenvs

This requires

(setq conda-anaconda-home "/opt/anaconda/python3.6"
      conda-env-home-directory "/opt/anaconda"
      conda-env-subdirectory "myenvs"))

Since the docstring of conda-env-subdirectory suggests that the dirname will be added to conda-anaconda-home, some people who do not look at the src code may fail to understand that they need to configure it. They will leave it at the default "envs" value. Maybe #45 has this problem, but he does not provide enough information on his specific settings.

Thank you, it works.

Nathan-Furnal commented 4 years ago

@necaris

This was really helpful to me, can this be added to the README perhaps ?

I use miniconda on Linux and my setup looks like this :


(use-package conda
  :defer t
  :init
  (setq conda-anaconda-home "~/miniconda3/condabin/conda" ; which conda 
        conda-env-home-directory "~/miniconda3/"          ; where the base env is
        conda-env-subdirectory "envs")            ; sub dir with the envs 
  (conda-env-autoactivate-mode t))                        ; auto-activate
necaris commented 4 years ago

@Nathan-Furnal see #57 which should add more clarity here :smile:

Nathan-Furnal commented 4 years ago

Thanks for the fix!

For posterity, my current install which works perfectly is as such:

(use-package conda
  :defer t
  :init
  (setq conda-anaconda-home (expand-file-name "~/miniconda3")
        conda-env-home-directory (expand-file-name "~/miniconda3"))
  :config
  (conda-env-initialize-interactive-shells)
  (conda-env-initialize-eshell))