Having some troubles, but its not app breaking

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Having some troubles, but its not app breaking

Cody Granger
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 [hidden email].
To post to this group, send email to [hidden email].
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.
Reply | Threaded
Open this post in threaded view
|

Re: Having some troubles, but its not app breaking

Eric Fahlgren
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 <[hidden email]> 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 [hidden email].
To post to this group, send email to [hidden email].
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.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/CAP2Qz%2BUb8wGVcaYKMn%2Bfhi3ioB7-UwO0-sFnxWwmX%2BZCU4jPSw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Having some troubles, but its not app breaking

Cody Granger
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 href="javascript:" target="_blank" gdf-obfuscated-mailto="WJxIpp5NAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">a.a.o...@...> 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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="WJxIpp5NAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">pyins...@googlegroups.com.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="WJxIpp5NAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">pyins...@....
Visit this group at <a href="https://groups.google.com/group/pyinstaller" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/group/pyinstaller&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/group/pyinstaller&#39;;return true;">https://groups.google.com/group/pyinstaller.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/pyinstaller/00d5d5c2-85d7-4557-bb73-f34057cd3dc4%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/pyinstaller/00d5d5c2-85d7-4557-bb73-f34057cd3dc4%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/pyinstaller/00d5d5c2-85d7-4557-bb73-f34057cd3dc4%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/pyinstaller/00d5d5c2-85d7-4557-bb73-f34057cd3dc4%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
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 [hidden email].
To post to this group, send email to [hidden email].
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/84b51f9f-8e77-4771-8d18-d10cd50e4ae7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.