GithubHelp home page GithubHelp logo

Comments (26)

SergiyKolesnikov avatar SergiyKolesnikov commented on August 20, 2024 1

I worked around this issue by setting conda-env-home-directory to the same value as conda-anaconda-home in the init.el.

I believe, the regression was introduced in 2c27196 and affects configurations with non-default conda-anaconda-home (e.g., /opt/anaconda3/ instead of the default ~/.anaconda3/).

For a non-default Anaconda path, the documentation instructs to set only conda-anaconda-home in init.el, but conda-env-home-directory still gets the default path ~/.anaconda3/ from conda-anaconda-home when the mode is initialized:

conda.el/conda.el

Lines 50 to 51 in ffafcc4

(defcustom conda-env-home-directory conda-anaconda-home
"Location of the directory containing the environments directory."

An easy fix would be to update the docs accordingly, but it would be nice if conda-env-home-directory were updated automatically in case only conda-anaconda-home is customized.

from conda.el.

necaris avatar necaris commented on August 20, 2024 1

@SergiyKolesnikov since you appear to have found an underlying cause I'm reopening this to take a deeper look when I get a minute -- thank you!

from conda.el.

hnisonoff avatar hnisonoff commented on August 20, 2024 1

I had to change

(setq conda-env-home-directory (expand-file-name "~/anaconda3/envs")
	)

to

(setq conda-env-home-directory (expand-file-name "~/anaconda3/")
	)

from conda.el.

c02y avatar c02y commented on August 20, 2024 1

M-x conda-env-list show no result, but in terminal conda env list show 3 envs including base env.

from conda.el.

sampotter avatar sampotter commented on August 20, 2024

I'm having the same problem. Any thoughts about how to fix this?

from conda.el.

necaris avatar necaris commented on August 20, 2024

Sorry for the delayed response! I haven't been able to reproduce this on my Emacs on OS X, but a question: are you using the exec-path-from-shell package? And can you paste the output of the *Messages* buffer after you run conda-env-list?

from conda.el.

sampotter avatar sampotter commented on August 20, 2024

Hmm, problem seems to be fixed for me! I haven't tried this since my last message here, but just reinstalled conda.el, and it's also possible I'm using a new version of Emacs since then.

At the time of the problem, I was using exec-path-from-shell, in case that helps.

from conda.el.

necaris avatar necaris commented on August 20, 2024

@kittipatv are you still seeing this problem?

from conda.el.

zjp avatar zjp commented on August 20, 2024

I'm currently having this issue. It seems like the docs expect anaconda to be in ~/ but homebrew sticks anaconda in /usr/local/ -- I took ownership of the directory but it looks like it isn't reading the environments there.

from conda.el.

necaris avatar necaris commented on August 20, 2024

@zjp thank you, that's a really helpful clue! Can you try telling conda.el where to find your Anaconda installation by setting the conda-anaconda-home customizable variable? You can set this in your .emacs / init.el with:

(custom-set-variables
 '(conda-anaconda-home "/path/to/my/Anaconda"))

Or, to update the value in your current session, try M-x customize-variable RET conda-anaconda-home RET and enter the correct path there.

Once you've done this, are you able to activate an environment?

from conda.el.

zjp avatar zjp commented on August 20, 2024

I had had that variable set to /usr/local/anaconda3 (after I took ownership of the folder) -- I tried also adding /usr/local/anaconda3/envs to conda-env-home-directory but couldn't get the menu to populate.

from conda.el.

necaris avatar necaris commented on August 20, 2024

@zjp any chance you can paste the contents of your *Messages* buffer after you try conda-env-activate?

from conda.el.

zjp avatar zjp commented on August 20, 2024

There is no output that I can see.

from conda.el.

zjp avatar zjp commented on August 20, 2024

Hmmm... I rebuilt my Emacs init file and miraculously, it now finds environments in /usr/local/anaconda3. Regrettably, I'm not sure what exactly I did or I'd state what it was to try and help the original user.

from conda.el.

necaris avatar necaris commented on August 20, 2024

@zjp thank you for the update! Since two of the three people who reported the issue are reporting it's fixed now, I'm going to go ahead and close it -- @kittipatv if you are still seeing this problem please reopen!

from conda.el.

SergiyKolesnikov avatar SergiyKolesnikov commented on August 20, 2024

@necaris thanks for looking into this. Just wanted to note that this issue is not OSX specific, I am using Debian 10.

from conda.el.

simenojensen avatar simenojensen commented on August 20, 2024

@necaris, I am having a similar problem.

These are my configs:

(use-package conda
    :config
    (setq conda-anaconda-home "/usr/local/Caskroom/miniconda")
    (setq conda-env-home-directory "/usr/local/Caskroom/miniconda")
    (conda-env-initialize-interactive-shells)
    (conda-env-initialize-eshell))

I am also using exec-path-from-shell.

M-x conda-env-list is empty
M-x conda-env-activate-path lets me choose an environment from my file directory. But when I try to M-x conda-env-activate it, I receive the following error message:

Debugger entered--Lisp error: (error "No such conda environment: ")
signal(error ("No such conda environment: "))
error("No such conda environment: %s" "")
conda-env-name-to-dir("")
conda-env-is-valid("")
conda-env-activate()
funcall-interactively(conda-env-activate)
call-interactively(conda-env-activate record nil)
command-execute(conda-env-activate record)
counsel-M-x-action("conda-env-activate")
...

from conda.el.

hnisonoff avatar hnisonoff commented on August 20, 2024

I am also having this same problem.

from conda.el.

ivan-krukov avatar ivan-krukov commented on August 20, 2024

Aside, from the comments from @SergiyKolesnikov, there is an issue of how the env dirs are validated.

The conda--env-dir-is-valid function checks if the candidate directory contains bin or Scripts (on windows). It seems that those will not necessarily be contained by the environment dirs. Simply adding a bin dummy subdirectory into ~/<condapath>/envs/my-env/ makes my-env discoverable by conda-env-activate.

I think that the only subdir that a conda env should contain is conda_meta (or at least this appears to be the case on my machine.

from conda.el.

simenojensen avatar simenojensen commented on August 20, 2024

For miniconda installed with Homebrew, this fixed the error:

(setq conda-anaconda-home "/usr/local/Caskroom/miniconda/base/")

from conda.el.

simenojensen avatar simenojensen commented on August 20, 2024

Mac OS - Homebrew - miniconda update:
Homebrew now installs miniconda under /opt.

This works for me now:
(setq conda-anaconda-home "/opt/miniconda3/")

from conda.el.

 avatar commented on August 20, 2024

I had to change

(setq conda-env-home-directory (expand-file-name "~/anaconda3/envs")
	)

to

(setq conda-env-home-directory (expand-file-name "~/anaconda3/")
	)

@hnisonoff Thank you! I'd like to add that the same solution is valid under spacemacs on Ubuntu/WSL2, under dotspacemacs-configuration-layers:

(conda 
:variables
conda-anaconda-home (expand-file-name "~/anaconda3") 
conda-env-home-directory (expand-file-name "~/anaconda3"))

from conda.el.

necaris avatar necaris commented on August 20, 2024

Does 335474e add enough documentation to be able to work around this issue? I'd like to close if so.

from conda.el.

funnell avatar funnell commented on August 20, 2024

hi @necaris, like others here I had to set conda-env-home-directory which wasn't clear from the current README. My anaconda directory is in ~/miniconda3 and from the documentation I mistakenly thought that if my env dir was in ~/miniconda3/envs (as it is for me) then I didn't need to also set conda-env-home-directory.

from conda.el.

necaris avatar necaris commented on August 20, 2024

@funnell @simenojenson @c02y are you folks still having issues, or does this work for you all now?

from conda.el.

necaris avatar necaris commented on August 20, 2024

Closing as resolved since no response to my earlier question, but please reopen if necessary!

from conda.el.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.