Emacs and conda workaround

后端 未结 4 1489
暖寄归人
暖寄归人 2021-01-18 05:01

I\'m using emacs and anaconda.

I have this in my init.el:

(setenv \"WORKON_HOME\" \"/home/user/anaconda3/envs/\")

And conda on my p

4条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-18 05:40

    What I found works for me is to use the conda package from ELPA and set two of its configuration variables to point to my Conda directory. The following snippet does the trick in my .emacs:

    (use-package conda
      :ensure t
      :init
      (setq conda-anaconda-home (expand-file-name "~/miniconda3"))
      (setq conda-env-home-directory (expand-file-name "~/miniconda3")))
    
    • conda-anaconda-home is the equivalent to the ANACONDA_HOME environment variable (i.e. contains all files of your Anaconda installation)
    • conda-env-home-directory - is the directory where your virtual environments get stored (within the envs subdirectory)

    With this configuration I'm able to run M-x conda-env-activate and have access to all previously created envs.

提交回复
热议问题