Sometimes I download the python source code from github
and don\'t know how to install all the dependencies. If there is no requirements.txt
file I
Make sure to run pip3 for python3.7.
pip3 freeze >> yourfile.txt
Before executing the above command make sure you have created a virtual environment.
python3:
pip3 install virtualenv
python3 -m venv <myenvname>
python2:
pip install virtualenv
virtualenv <myenvname>
After that put your source code in the directory. If you run the python file now, probably It won't launch If you are using non-native modules. You can install those modules runing
pip3 install <module> or pip install <module>
This will not affect you entire module list except the environment you are In.
Now you can execute the command at the top and now you have a requirements file which contains only the modules you installed in the virtual environment. Now you can run the command at the top.
I advise everyone to use environments as It makes things easier when It comes to stuff like this.
Hope this helped.