I have a question that I cannot seem to find the right answer for (perhaps I am articulating it incorrectly).
My program is dependent on Numpy and datetime. should I include those inside the modules folder? Or is it assumed that some of the fundamental packages are already going to be installed on the computer the end user will use?
Layout:
PROGRAM_NAME/
-main
-Readme
--/Modules
-__init__
-constants
-program_name
Edit:
You could start by adding a requirements.txt
to your project, although this is outdated advice if you want to build a package, but will be fine for small projects. If you want to build a package, take a look at this documentation about PEP517: https://peps.python.org/pep-0517/
You can also use other build tools to build packages like https://github.com/python-poetry/poetry
This shell command will export your projects dependencies as a file named requirements.txt:
pip freeze > requirements.txt
Once you’ve got your requirements file, you can head over to a different computer or new virtual environment and run the following:
pip install -r requirements.txt
A requirements file is a list of all of a project’s dependencies. This includes the dependencies needed by the dependencies. It also contains the specific version of each dependency, specified with a double equals sign (==).
Read more here: https://realpython.com/lessons/using-requirement-files/
The best place to put dependencies would be in a requirements.txt
file. Then to install all the requirements, use pip install -r /path/to/requirements.txt
.
More information on requirements.txt
can be found here in the pip documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With