How to create a requirements.txt for python
First, you must to detect every python package that you need to your proyect.
An option is to use the following sentence:
grep import file_name.py
Now, you need to create a file called requirements.in with every package per line as:
julia
networkx
To finalize, the version of each package must be included in the file. To do it, just use:
pip-compile requirements.in
An option is to use the following sentence:
grep import file_name.py
Now, you need to create a file called requirements.in with every package per line as:
julia
networkx
To finalize, the version of each package must be included in the file. To do it, just use:
pip-compile requirements.in
The file requirements.txt was created.
To run it in other environment, execute the following sentence:
pip install -r requirement.txt
Enjoy it!
Comments
Post a Comment