There was talk about sharing virtual environments with Git, but it was refreshing, so I looked it up.
If you know it, you can skip it.
Integrated Development Environment (IDE) vs. Virtual environment
I will write below about the specific method of sharing the virtual environment with Git. I referred to this article.
Sharing a virtual environment with Git means that someone creates a virtual environment and shares it with a team **, not **, each creates a new Python virtual environment in each pc, and in that Load a file called ** requirements.txt ** that describes the package libraries required for the project. This means that you can ** share requirements.txt with Git **.
Get the list of package libraries in your current environment here. Specifically, let's execute the following command in the terminal.
pip freeze > requirements.txt
This should generate requirements.txt in your project, so put it on GitHub.
The package library is not yet ready for use in the virtual environment just by saving the project containing requirements.txt. To install it you need to run the following command in the terminal:
pip install -r requirements.txt
This completes the sharing of the package library.
The Japanese word for sharing a virtual environment is likely to be misleading, and it is correct to share a package library, but I feel that the former is often used in everyday conversation (?), So leave the title as it is. ..
https://hitoribucho.com/post/20190309191626
Recommended Posts