pyvenv icon indicating copy to clipboard operation
pyvenv copied to clipboard

pyvenv-deactivate remove environment vars not related to virtualenvs

Open dacameron opened this issue 7 years ago • 3 comments

I hit an issue where I was trying to set an environment var and it kept disappearing. I soon realised it was pyvenv-deactivate restoring the old process environment.

pyvenv-activate and pyvenv-deactivate should only replace and restore environment variables which are relevant to the virtualenv (PATH, VIRTUALENV and PYTHONHOME)

dacameron avatar May 23 '17 01:05 dacameron

Oh an thanks for making this available. I have been using it in my emacs setup for the past 3 years or so. Nice work!

dacameron avatar May 23 '17 01:05 dacameron

Hello, and thanks for the report (and the kind words! :-)) – you are right, pyvenv should mimic the behavior of virtualenv, i.e. restore PATH and PYTHONHOME only.

jorgenschaefer avatar May 26 '17 12:05 jorgenschaefer

so I think pyvenv-deactivate deleted my .emacs config and .emacs.d/ contents. I'm still not sure, but I had set the virtual envs path to a folder I had on my ~/ but when I created a new virtual env pyvenv created a ~ folder, so I deleted the one I created. When I finished doing What I was doing I typed pyvenv-deactivate, it gave an error and puff everything is gone

Alf0nso avatar Sep 17 '20 23:09 Alf0nso