I try to use virtualenvwrapper.el with the build-in
python.el and my virtual environments in a
./.venv directory inside each project.
Because all virtual envs have the same name
.venv I cannot make a list of all venvs in
venv-location. What I do instead is, when I want to work in a particular environment (say
~/my/project/.venv), I set:
(setq venv-location (list "~/my/project/.venv")) (venv-workon (venv-dir-to-name "~/my/project/.venv")))
This works as expected for instantiating the inferior Python process via
M-x run-python: This process runs in the virtual env
venv-workon seems to change Emacs' general PATH variable, normal swells (started with M-x shell
) are affected too: They all get the virtual env~/my/project/.venv`. But I do not want this for my normal shells.
How can I manage my Python virtual environments for
python.el's Python processes , but not for shell and all other processes? Do other libraries (like
pyenv) handle this as I want it?(*)
(*) I had tried pyvenv earlier and if I remember it right I had the same issue: Normal shell get thesame virtual env as my python project.