I have a python project where the size of the output executable is critical. And now the size of this file does not satisfy me.

Использую IDE - PyCharm Для сборки в исполняемый файл использую - Pyinstaller Версия Python - 3.6.5 

Tell me, is there any tool that gives me all the dependencies of the project? So much so that if, for example, in some of the modules I use BeautifulSoup, which uses lxml, I was given information about both.

If there is something like this for PyCharm, I will be especially happy.

  • one
    Most of the size of the executable file is the Python interpreter itself. Packages - a drop in the ocean. - Sergey Gornostaev
  • one
    @SergeyGornostaev, unless the packages pull libraries along, for example PyQt - gil9red

1 answer 1

Yes, there is - pip list or pip freeze .

To see the dependency tree, you can install pipdeptree :

 $ pip install pipdeptree $ pipdeptree -fl Warning!!! Cyclic dependencies found: ------------------------------------------------------------------------ xlwt==0.7.5 ruamel.ext.rtf==0.1.1 xlrd==0.9.3 openpyxl==2.0.4 - jdcal==1.0 pymongo==2.7.1 reportlab==3.1.8 - Pillow==2.5.1 - pip - setuptools 
  • Clumsy somehow works. Here one module causes heavy BeautifulSoup, but this module is not used anywhere at all in the project. - witaway
  • Commands show dependencies installed in a virtual environment. If you do not use it, then you should not have installed it. - Sergey Gornostaev
  • And it would be interesting to see that lxml comes to me not from the air, but from a specific BeautifulSoup, which is called in a specific file .. - witaway