Comments (26)
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:
Lines 50 to 51 in ffafcc4
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.
@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.
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.
M-x conda-env-list
show no result, but in terminal conda env list
show 3 envs including base env.
from conda.el.
I'm having the same problem. Any thoughts about how to fix this?
from conda.el.
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.
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.
@kittipatv are you still seeing this problem?
from conda.el.
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.
@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.
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.
@zjp any chance you can paste the contents of your *Messages*
buffer after you try conda-env-activate
?
from conda.el.
There is no output that I can see.
from conda.el.
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.
@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.
@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.
@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.
I am also having this same problem.
from conda.el.
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.
For miniconda installed with Homebrew, this fixed the error:
(setq conda-anaconda-home "/usr/local/Caskroom/miniconda/base/")
from conda.el.
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.
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.
Does 335474e add enough documentation to be able to work around this issue? I'd like to close if so.
from conda.el.
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.
@funnell @simenojenson @c02y are you folks still having issues, or does this work for you all now?
from conda.el.
Closing as resolved since no response to my earlier question, but please reopen if necessary!
from conda.el.
Related Issues (20)
- Error auto activating base env with custom conda home HOT 4
- conda-env-activate doesn't work but conda-env-list does HOT 6
- conda-env-name-to-dir errors HOT 3
- Error activating env HOT 16
- `conda-env-subdirectory` variable
- Add conda-config (similar to elpy-config) command to re-evaluate cached values HOT 2
- When python-shell-interpreter is set to "jupyter", conda is unable to change the environment of the interpreter. HOT 4
- Prefix is not added in shell prompt in Emacs 29.0.60 HOT 3
- Is there a reason not to get the user's config by default if it exists? HOT 4
- Activating environment when using 'emacs file.py'
- conda-env-activate-for-buffer sets PATH to "", causing "ls" "git" "bash" to fail HOT 9
- Error: `(void-function working-dir)` HOT 2
- Error when running the suggested config
- Eshell Python does not track environment HOT 2
- once conda-env-autoactivate-mode is called for one buffer, it activates for everyfile
- Auto Activate only for Python-mode
- Invalid version syntax HOT 5
- Add support for direct python invocation in the current environment
- Only .yml extension is recognised for activating environment
- conda.el, elpy, and python-mode conflicts
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from conda.el.