0

I am trying to contribute to python's pip module.

However, some pip modules do not include requirements.txt in their source code repository.

In this situation, when i clone the project and run the test code, the following error occurs.

$ python test
ModuleNotFoundError: No module named 'mock'

Of course, if i install it with pip install mock, i can prevent an error that occurs because the mock module does not exist, but there is a high possibility that an error may occur due to other modules as follows.

$ pip install mock
$ pip freeze > requirements.txt
$ python test
ModuleNotFoundError: No module named 'nose'

How can I install all the dependencies of a cloned project at once?

The project I want to contribute is python-ipmi.


For example, the modules of node.js include package.json in the source code repository.

For this reason, if i clone the project and npm install, i can download all of the module's dependent modules.

$ git clone https://github.com/validatorjs/validator.js

$ npm install

1 Answers1

1

You can use the following code to generate a requirements.txt file:

pip install pipreqs

pipreqs /path/to/project

for more info, check out Automatically create requirements.txt

Wilson.L
  • 91
  • 3