virtualenvwrapper: where is virtualenv info stored?
I regularly use
setvirtualenvproject /path/to/my/project/ to set the root/base directory of my virtual env. This is useful when switching to a virtual env using
I was wondering though, if this path is available anywhere else?
In my case, I want to run a pre-push hook in git, and need to get the full path to some of my files.
e.g. something like this in my pre-push hook:
Is there any way I can retrieve this ‘virtualenvproject’ info, or where is it stored?
I’ve tried looking in
.virtualenvs dir and every other place I can think of, but I just can’t find where the info’s stored.
One Solution collect form web for “virtualenvwrapper: where is virtualenv info stored?”
OK, seems like there were no quick takers… I ended up looking at the virtualenvwrapper.sh source, which shows that the path is dumped into
echo $VIRTUALENVWRAPPER_PROJECT_FILENAME will show you the name for your project settings (default is
The fact that it’s hidden is what was killing me.
So now I know this, I can do a simple:
cat $VIRTUAL_ENV/$VIRTUALENVWRAPPER_PROJECT_FILENAME to get the setting. Simple!