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 

The file requirements.txt was created. 
To run it in other environment, execute the following sentence:

pip install -r requirement.txt

Enjoy it!

Comments

Popular posts from this blog

Exception: Could not find a default OpenFlow controller in Mininet

How to fix Android when developer options are not available for this user

Webcam streaming throught VLC with YUY2 compatibility