pyvenv icon indicating copy to clipboard operation
pyvenv copied to clipboard

`pyvenv-tracking-mode` doesn't work (or it's not clear how it's supposed to work)

Open posita opened this issue 3 years ago • 0 comments

I have pyvenv-tracking-mode set to t. I use pyvenv-workon via .dir-locals.el. I have:

+- proj_a
|   +- a.py
|   `- .dir-locals.el
`- proj_b
    +- a.py
    `- .dir-locals.el
% lsvirtualenv
proj_a
======


proj_b
======


;; proj_a/.dir_locals.el
(
 (python-mode
  (eval pyvenv-workon "proj_a"))
 )
;; proj_b/.dir_locals.el
(
 (python-mode
  (eval pyvenv-workon "proj_b"))
 )

I open …/proj_a/a.py and (pyvenv-workon "proj_a") is invoked for that buffer (M-x getenv PATH concurs).

Next, I open …/proj_b/b.py and (pyvenv-workon "proj_b") is invoked for that buffer (again, M-x getenv PATH concurs).

Now, I switch back to the already open buffer for …/proj_a/a.py. M-x getenv PATH still shows that proj_b is the active virtual environment.

https://github.com/jorgenschaefer/pyvenv/issues/80#issuecomment-429231820 is vague. It suggests pyvenv-tracking-mode can be used, but fails to explain how.

posita avatar Mar 08 '22 15:03 posita