PyInstaller: Unnecessary Modules | Sololearn: Learn to code for FREE!


PyInstaller: Unnecessary Modules

I have made a 2 level directory python project, and have converted to onedir console-based exe using Auto-py-to-exe which uses PyInstaller. The directory is pretty unorganised as expected but I find that there are many folder named "PyQt5", "PIL", "cv2", "scipy", "PySide2", etc... These are the names of modules, I have them installed in my system but did not use them in my project. What I do not understand is, Even though I haven't used these modules in my project, these directories are there in onedir exe, Why? Is it safe to delete them?

10/21/2021 9:03:31 AM

Arun Bhattacharya

3 Answers

New Answer


Richard, does it really have any connection with the IDE... btw I am using Visual Studio Code


Well Arun Bhattacharya ,I suspect that your problem may be caused by the fact that you did not use a virtual environment .Whereby pycharm creates this environment automatically , I'm not entirely sure. because I'm not there to see it in person . If ur don't know what a virtual environment Is Click this:


If ur want help tell us which IDE ur using