Search code examples
pythonpython-3.xpython-2.7pippython-module

How To Find What Modules Are Used By A Python File


I Got this small question in my mind. while we are installing any third-party modules. some other modules will also get installed along with It. How To Find What All Additional Modules Are Installed. For Example this code.

from gtts import gTTS 

While Install this module some other modules like "six" Are Getting Installed.

How to Find What Extra Modules Are Getting Installed while I install gtts or any other modules


Solution

  • You can get a list of modules installed for your program using pip freeze

    pip freeze > requirements.txt
    

    This requirements.txt list all the package required by your program.