Should we include inbuilt libraries in the requirements.txt file !?
In Python, requirements.txt file is a type of file that usually stores information about all the libraries, modules, and packages in itself that are used while developing a particular project.
It also stores all files and packages on which that project is dependent or requires to run.
When you try to install inbuilt libraries like math
, os
, sys
, etc following error message occurs -
ERROR: Could not find a version that satisfies the requirement math (from -r requirements.txt (line 7)) (from versions: none)ERROR: No matching distribution found for math (from -r requirements.txt (line 7))
Any modules that are part of Python’s standard library such as math
, os
, sys
, etc need not be listed in your requirements.txt
file.
Any third party libraries that you include within your project using pip install ______
should be added.
You can find a list of standard modules included within core Python (built-in functions) in this link.
You can also enter the following command within a Python interpreter session to see them listed in your terminal.
>>> help('modules')
Hope you found it helpful !