Open joostkremers opened 2 years ago
Perhaps related: If I run a shell after activating an environment (with M-x shell
), the shell starts up but prints an error 'activate' is not recognized as an internal or external command, operable program or batch file.
Typing conda activate <env_name>
also doesn't work.
I haven't used Windows in a while, unfortunately; how do you activate an environment if you don't use conda activate
?
@joostkremers any more details here?
Unfortunately, no. I've stopped using Windows, so I can't troubleshoot anymore. I did try removing Anaconda completely and using python-poetry instead to manage my environments, but never really got that working either. So I probably messed something up with my Python environment that also may have affected conda.el
. (Either that or I'm just too stupid to use Windows. :smile: )
I'll leave it up to you whether to close this issue or not. As a bug report, it's probably not very useful... :disappointed:
In case someone finds this, I ran into similar problems. In this case, it was because python-shell-interpreter
was set to python3.exe
so, although conda.el did fix up the OS PATH
and exec-path
, emacs (run-python?) was falling through to the only python3.exe it could find, MSYS2's /usr/bin/python3.exe
.
The fix is to set it as part of the conda.el init: (setq python-shell-interpreter "python")
. It's still early in the python/emacs setup journey, but at least the environment is being activated.
I'm trying to set up
conda.el
on Windows, and I'm running into some problems. Initially, all I had in my init file was this:This seemed to leave my PATH unchanged when activating an environment: after
M-x run-python
, doing:showed that the environment directories weren't added to PATH. (They were added to
exec-path
, though).Once I changed the config to:
PATH looks correct, but there are still issues.
For one, I don't seem to be able to properly activate an environment with a Python version that does not correspond to the Python version in the base environment. base has Python 3.8.8, and if I activate an environment that has Python 3.7.12, I get the warning:
Then, if I exit the interpreter, deactivate the environment and try to activate one that has Python 3.8,
M-x run-python
still shows Python 3.7...If an environment with Python 3.8 is the first environment I activate in an Emacs session,
run-python
doesn't give me this error.Any idea what's going on here? Or tips where to start troubleshooting? I'm a bit at a loss, since I normally use Linux and I also haven't used conda before to handle my environments, so any help would be appreciated.