eugene
eugene

Reputation: 41725

How do you replicate a virtualenv?

I just started using virtualenv in python.

I'm installing several package(?) using pip on the virtualenv.

Is there a record what packages are installed in a virtualenv so that I can replicate the same environment in a different machine?

Upvotes: 3

Views: 1177

Answers (2)

kojiro
kojiro

Reputation: 77137

Another approach is to make your virtualenv relocatable and then recursively copy it.

virtualenv --relocatable "$path_to_existing_virtual_env"
cp -r "$path_to_existing_virtual_env" "$path_to_duplicate_virtual_env"

Upvotes: 0

Simon Whitaker
Simon Whitaker

Reputation: 20576

On the first virtual env:

pip freeze > requirements.txt

On the second:

pip install -r requirements.txt

Easy!

Upvotes: 8

Related Questions