Having some troubles, but its not app breaking

33 views
Skip to first unread message

Cody Granger

unread,
May 8, 2019, 3:05:52 AM5/8/19
to PyInstaller
Hey everyone.

So I've been working with python for a few months now, and have been coding this choose your adventure style game, and have no issues when I've tried to make that into an Exe(thousand plus lines of code, 2 .py files, 5 .txt files, under 5mb) with Auto Py to Exe, however I coded this simple English to other language translator that takes the English you type and converts it into the chosen language via creating an img file which is fine for my brothers needs. The issue I come to is that while making the Exe, pyinstaller, or the Auto py to exe tries to pull from Django library(Which I do have installed but the only three things I call in my translator code is;

from PIL import Image, ImageDraw, ImageFont
import os
import sys

Could anyone help me to figure out why? Like the title says, it doesn't break my app, but along with django, theeres a few things that are 
brought into the exe that are taking up so much space that doesn't need to be there. The total size of the file is 35mb. 
For 80 lines of code and 3 fonts, I feel like something is wrong

If it helps, and I'm sure it does, I can post a log. Just want to know if theres any special way you'd like me to post it before just posting
the 100+ lines of error messages lmao

Eric Fahlgren

unread,
May 9, 2019, 4:13:22 AM5/9/19
to pyins...@googlegroups.com
Cody, the issue is dependencies.  You as a human look at the installation and can say, "Hey, that isn't used," but PyInstaller is not as smart and sees a big library like PIL or django and has to assume that anything in those libraries that is possibly connected must be included.  To make up an example, if you pull sqrt out of math, but some other routine in math sucks in the whole time zone library and conversion tables so that it can add dates, then PyInstaller would include those, just in case...

If you can isolate some module that you know is not needed, you can use the '--exclude-module' command line parameter, or put an 'excludes =()' entry in the Analysis section of your .spec file (if you use one).

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyinstaller...@googlegroups.com.
To post to this group, send email to pyins...@googlegroups.com.
Visit this group at https://groups.google.com/group/pyinstaller.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyinstaller/00d5d5c2-85d7-4557-bb73-f34057cd3dc4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Cody Granger

unread,
May 9, 2019, 4:41:53 AM5/9/19
to PyInstaller
Okay I understand that. Still am confused as why one program I make does include, for example django, but another one I make doesn't. Either or, I was reading into it else where, before and after posting this, and I was reading somewhere about making a virtual environment, which I know how to do, well with pycharm as it makes it so easy, but even after making a virtualenv with only the packages I need installed, then running a cmd line within the virtualenv, it's still pulling django and all the other unnecessary modules, which it shouldn't have? Idk im really confused. 

But this program works awesome with my other program so for now I'm content on not needing an immediate solution.


On Thursday, 9 May 2019 02:13:22 UTC-6, Eric Fahlgren wrote:
Cody, the issue is dependencies.  You as a human look at the installation and can say, "Hey, that isn't used," but PyInstaller is not as smart and sees a big library like PIL or django and has to assume that anything in those libraries that is possibly connected must be included.  To make up an example, if you pull sqrt out of math, but some other routine in math sucks in the whole time zone library and conversion tables so that it can add dates, then PyInstaller would include those, just in case...

If you can isolate some module that you know is not needed, you can use the '--exclude-module' command line parameter, or put an 'excludes =()' entry in the Analysis section of your .spec file (if you use one).

On Wed, May 8, 2019 at 12:05 AM Cody Granger <a.a.o...@gmail.com> wrote:
Hey everyone.

So I've been working with python for a few months now, and have been coding this choose your adventure style game, and have no issues when I've tried to make that into an Exe(thousand plus lines of code, 2 .py files, 5 .txt files, under 5mb) with Auto Py to Exe, however I coded this simple English to other language translator that takes the English you type and converts it into the chosen language via creating an img file which is fine for my brothers needs. The issue I come to is that while making the Exe, pyinstaller, or the Auto py to exe tries to pull from Django library(Which I do have installed but the only three things I call in my translator code is;

from PIL import Image, ImageDraw, ImageFont
import os
import sys

Could anyone help me to figure out why? Like the title says, it doesn't break my app, but along with django, theeres a few things that are 
brought into the exe that are taking up so much space that doesn't need to be there. The total size of the file is 35mb. 
For 80 lines of code and 3 fonts, I feel like something is wrong

If it helps, and I'm sure it does, I can post a log. Just want to know if theres any special way you'd like me to post it before just posting
the 100+ lines of error messages lmao

--
You received this message because you are subscribed to the Google Groups "PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyins...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages