I'm curious about Python Virtualenv.

Asked 2 years ago, Updated 2 years ago, 87 views

Hello. As I searched for it, in the Jango Girls tutorial

He started the project by creating Python Virtualenv.

I think it's really good to create an independent development environment.

I wonder if they create a virtual environment in real service~

virtualenv python

2022-09-22 20:40

1 Answers

I think it depends on the choice. If your deployment uses a fixed version of Python interpreter, you can also extract the package information that you used in your virtual environment as text and install it at once.

Output package list installed with pip
Save a list of packages in use in your environment in requirements.txt

$ pip freeze > requirements.txt

Automatic installation of printed package list information
Install all using requirements.txt

$ pip install -r requirements.txt 

In this way, you can ensure that each environment maintains the same package version and dependency.


2022-09-22 20:40

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.