2

I have an application and now I would like to know what packages/modules are necessary if someone else wants to install it. How can I get all the python modules/packages that are needed for a specific project?

Important Note: This question was already answered for Linux. They suggested pipreqs, which seems like a great solution, however it does not to support Windows.

My Python version is 3.6.4.

I am working on windows 10.

User12547645
  • 6,955
  • 3
  • 38
  • 69

2 Answers2

3

Have you verified that pipreqs does not work? I use Windows 10 (build 17134.285), Python 3.7.0, and pipreqs 0.4.9; and I have successfully generated requirements files using pipreqs.

C:\l\Projects\MicrosoftGraph>pipreqs .\sampleGraphAuthPython
INFO: Successfully saved requirements file in .\sampleGraphAuthPython\requirements.txt

C:\l\Projects\MicrosoftGraph>type .\sampleGraphAuthPython\requirements.txt
bottle==0.12.13
adal==1.1.0
Flask_OAuthlib==0.9.5
requests==2.19.1
Flask==1.0.2
requests_oauthlib==1.0.0
urllib3==1.23
LisaJ
  • 1,666
  • 1
  • 12
  • 18
1

Maybe you could use: pip freeze ?

This would output all the installed packages for your given project, for reference.

Hopefully that helps!

Nathan
  • 7,853
  • 4
  • 27
  • 50
  • 1
    Thank you very much for the suggestion. It seems to output all installed packages, even with the local flag – User12547645 Sep 25 '18 at 18:33
  • FWIW: I would recommend creating a new python virtual environment for each python project you develop for. Then you can have a sandboxed environment to explore libraries with on a project by project basis without the worry of messing up your system level python configurations. Worst case if you mess up an environment you can just blow it away with no consequences. Also if you do a pip freeze for that project you can see just the dependencies for that project. If you get a minute check out: https://docs.python.org/3/tutorial/venv.html it's pretty cool and may save you a headache later on :) – Nathan Sep 25 '18 at 19:27