python - Renaming a virtualenv folder without breaking it -
i've created folder , initialized virtualenv instance in it.
$ mkdir myproject $ cd myproject $ virtualenv env when run (env)$ pip freeze, shows installed packages should.
now want rename myproject/ project/.
$ mv myproject/ project/ however, when run
$ . env/bin/activate (env)$ pip freeze it says pip not installed. how rename project folder without breaking environment?
you need adjust install use relative paths. virtualenv provides --relocatable option. the docs:
normally environments tied specific path. means cannot move environment around or copy computer. can fix environment make relocatable command:
$ virtualenv --relocatable env
note: env name of virtual environment , must run outside env directory.
this make of files created setuptools or distribute use relative paths, , change scripts use activate_this.py instead of using location of python interpreter select environment.
note: must run after you've installed packages environment. if make environment relocatable, install new package, must run virtualenv --relocatable again.
Comments
Post a Comment