mr_bulrathi
mr_bulrathi

Reputation: 554

Can I use same virtual environment on different computers

On my office computer, I've made virtualenv one-for-rule-them-all at the Dropbox folder. I want to use this environment both at work and at home. Is this possible? (currently I'm not successful)

Upvotes: 9

Views: 3840

Answers (1)

Josh
Josh

Reputation: 3655

Look into using the relocatable option of virtualenv. For full documentation, see the virtualenv documentation on the subject.

One note of interest:

Also, this does not make your packages cross-platform. You can move the directory around, but it can only be used on other similar computers. Some known environmental differences that can cause incompatibilities: a different version of Python, when one platform uses UCS2 for its internal unicode representation and another uses UCS4 (a compile-time option), obvious platform changes like Windows vs. Linux, or Intel vs. ARM, and if you have libraries that bind to C libraries on the system, if those C libraries are located somewhere different (either different versions, or a different filesystem layout).

As an alternative to this approach, I would simply manage your project/setup dependencies with setup.py requirements (install_requires, setup_requires), or pip requirements.txt file. This is much more portable and cross-platform.

Upvotes: 5

Related Questions