[PYTHON] How to share a virtual environment [About requirements.txt]

Introduction

There was talk about sharing virtual environments with Git, but it was refreshing, so I looked it up.

What is a virtual environment?

If you know it, you can skip it.

Integrated Development Environment (IDE) vs. Virtual environment

Specific method

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 **.

About requirements.txt

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.

Bulk installation

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.

At the end

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. ..

reference

https://hitoribucho.com/post/20190309191626

Recommended Posts

How to share a virtual environment [About requirements.txt]
How to create a Python virtual environment (venv)
How to create a virtual bridge
How to build a new python virtual environment on Ubuntu
A note on how to load a virtual environment in PyCharm
How to develop in a virtual environment of Python [Memo]
How to build a sphinx translation environment
Add a Python virtual environment to VSCode
How about creating a virtual environment with Anaconda and doing pip install?
How to virtual host
[Note] How to create a Ruby development environment
[Note] How to create a Mac development environment
A memo to create a virtual environment (venv) before Django
How to set up a Python environment using pyenv
How to build a Django (python) environment on docker
How to build a development environment for TensorFlow (1.0.0) (Mac)
How to build a Python environment on amazon linux 2
[IPython] How to Share IPython Notebook
How to call a function
How to hack a terminal
Building a Python virtual environment
Building a Python virtual environment
A story about how Windows 10 users created an environment to use OpenCV3 with Python 3.5
A memo on how to easily prepare a Linux exercise environment
A story about how to specify a relative path in python.
I want to use a virtual environment with jupyter notebook!
A story about how to deal with the CORS problem
How to build a python2.7 series development environment with Vagrant
Overview of Python virtual environment and how to create it
How to make a Japanese-English translation
How to write a Python class
How to put a symbolic link
How to make a slack bot
How to create a Conda package
Create a virtual environment with Python!
How to make a crawler --Advanced
How to make a recursive function
Building a virtual environment with Python 3
How to make a deadman's switch
How to create a Dockerfile (basic)
[Blender] How to make a Blender plugin
How to delete a Docker container
How to make a crawler --Basic
Notes on how to write requirements.txt
How to create a config file
How to build a LAMP environment using Vagrant and VirtulBox Note
How about Anaconda for building a machine learning environment in Python?
How to build a Python environment using Virtualenv on Ubuntu 18.04 LTS
Spigot (Paper) Introduction to how to make a plug-in for 2020 # 01 (Environment construction)
From installing Ansible to building a Python environment in Vagrant's virtual environment
Learn how to use Docker through building a Django + MySQL environment
Install Django in a pipenv virtual environment
Building a virtual environment for Mayavi dedicated to Python 3.6, Anaconda, Spyder users
How to create a clone from Github
How to split and save a DataFrame
How to access environment variables in Python
About requirements.txt
How to create a git clone folder
Qiita (1) How to write a code name
Think about how to write a filter with the Shotgun API-Contact Versions
How to add a package with PyCharm