Home > Blockchain >  Creating requirements.txt for object-oriented multi-file project with dependencies in python
Creating requirements.txt for object-oriented multi-file project with dependencies in python

Time:02-08

I created an object-oriented simulation in python that has multiple files with dependencies between them. At the time, I didn't know any better and I didn't create a requirements.txt. I was wondering what the best way is to approach this. I am thinking creating a requirements.txt for each file, and then combining them into one requirements.txt for the whole project (I intend on posting that in my GitHub)

I would love some feedback.

CodePudding user response:

I suggest you use virtual environments. Create one and install the packages until you successfully run the code. The following materials will help. Automatically create requirements.txt How to use virtualenv with Python?

CodePudding user response:

Unless the files are for running independent processes/programs, I think a unified requirements.txt makes sense.

You can do this by running the following command in the terminal:

pip freeze > requirements.txt
  •  Tags:  
  • Related