haneulkim
haneulkim

Reputation: 4928

do I need to install packages every time in python virtual environment?

when I activate my virtual environment and install packages that I need, when I close the command prompt or turn off the computer do I need to install packages again?

Upvotes: 1

Views: 9846

Answers (3)

sandesh dahake
sandesh dahake

Reputation: 1026

No you don't need to install it again if you restart your machine.

You need to reinstall again only it you destroy your virtual image and recreate it. If your have such scenario I will suggest to use configure tools like Chef which can automated to install all your setups once you recreate your image.

Upvotes: 2

T Heath
T Heath

Reputation: 56

You don't need to re-install packages each time but you'll need to re-active the environment when you open a new prompt or turn your computer back on.

The Python Virtual Environment documentation covers how to activate and de-activate virtual environments.

Upvotes: 2

balderman
balderman

Reputation: 23825

If you talk about venv the answer is No. The packages you have installed in a specific venv are persisted to disk.

Upvotes: 1

Related Questions