python - Move the virtualenvs to another host folder -
by error, forgot specify workon_home variable before creating virtual environments, , created in /root/.virtualenvs directory. worked fine, , did testing activating environment , doing (env)$ pip freeze see specific modules installed there.
so, whe discovered workon home path error, needed change host directory /usr/local/pythonenv. created , moved contents of /root/.virtualenvs directory /usr/local/pythonenv, , changed value of workon_home variable. now, activating environment using workon command seems work fine (ie, promt changes (env)$), if (env)$ pip freeze, way longer list of modules before , not include ones installed in particular env before move.
i guess moving files , specifying dir workon_home variable not enough. there config should specify new location of host directory, or config files particular environment?
virtualenvs not default relocatable. can use virtualenv --relocatable <virtualenv> turn existing virtualenv relocatable one, , see if works. option experimental , not recommended use.
the reliable way create new virtualenvs. use pip freeze -l > requirements.txt in old ones list of installed packages, create new virtualenv, , use pip install -r requirements.txt install packages in new one.
Comments
Post a Comment