[GH-ISSUE #58] TypeError: startfile() takes no keyword arguments #55

Closed
opened 2026-02-26 12:20:19 +03:00 by kerem · 37 comments
Owner

Originally created by @joker8989 on GitHub (Jun 7, 2019).
Original GitHub issue: https://github.com/brentvollebregt/auto-py-to-exe/issues/58

I am trying to convert my file that uses exec() built in function to execute a string with base64
and when i use your app i get an error:
"Object of NoneType has no len()"

any idea how to convert it anyway ?
(replace maybe the exec somehow?)

Originally created by @joker8989 on GitHub (Jun 7, 2019). Original GitHub issue: https://github.com/brentvollebregt/auto-py-to-exe/issues/58 I am trying to convert my file that uses exec() built in function to execute a string with base64 and when i use your app i get an error: "Object of NoneType has no len()" any idea how to convert it anyway ? (replace maybe the exec somehow?)
kerem closed this issue 2026-02-26 12:20:19 +03:00
Author
Owner

@brentvollebregt commented on GitHub (Jun 8, 2019):

Could you give an example on how to reproduce this?

<!-- gh-comment-id:500077542 --> @brentvollebregt commented on GitHub (Jun 8, 2019): Could you give an example on how to reproduce this?
Author
Owner

@joker8989 commented on GitHub (Jun 8, 2019):

Could you give an example on how to reproduce this?

I am not sure what do you mean by to reproduce this?
my problem is that my script use exec() function to execute a base64(string) the script itself works fine but when i try to convert it to exe i get the error above..

is there a way to replace the exec() function to something to return me a value and then your program will work or to do something else, for example convert to exe although the return value is None by adding this feature to your program

<!-- gh-comment-id:500107351 --> @joker8989 commented on GitHub (Jun 8, 2019): > Could you give an example on how to reproduce this? I am not sure what do you mean by to reproduce this? my problem is that my script use exec() function to execute a base64(string) the script itself works fine but when i try to convert it to exe i get the error above.. is there a way to replace the exec() function to something to return me a value and then your program will work or to do something else, for example convert to exe although the return value is None by adding this feature to your program
Author
Owner

@brentvollebregt commented on GitHub (Jun 9, 2019):

An example of how to reproduce this would be the code that you can prove doesn't work. Here is one that I made up:

a = 5
assert a == 5
exec('a = 1')
assert a == 1
print(a)

Running that will Python, you will see that the exec works and "1" is printed. After packaging this with auto-py-to-exe and running it again, you will see that "1" is printed again.

This snippet however shows that exec does in-fact work. Do you have an example that doesn't work? Are you checking your code actually works in Python before packaging it?

<!-- gh-comment-id:500179901 --> @brentvollebregt commented on GitHub (Jun 9, 2019): An example of how to reproduce this would be the code that you can prove doesn't work. Here is one that I made up: ```python a = 5 assert a == 5 exec('a = 1') assert a == 1 print(a) ``` Running that will Python, you will see that the `exec` works and "1" is printed. After packaging this with auto-py-to-exe and running it again, you will see that "1" is printed again. This snippet however shows that `exec` does in-fact work. Do you have an example that doesn't work? Are you checking your code actually works in Python before packaging it?
Author
Owner

@joker8989 commented on GitHub (Jun 9, 2019):

yes can you please provide me your email or something that i can contact
with you cause its kind of private... :)

sry for sharing my problems :(

<!-- gh-comment-id:500198853 --> @joker8989 commented on GitHub (Jun 9, 2019): yes can you please provide me your email or something that i can contact with you cause its kind of private... :) sry for sharing my problems :(
Author
Owner

@brentvollebregt commented on GitHub (Jun 9, 2019):

No, I only want a small snippet of your code (like a proof of concept) so that I can package it and then execute the output to debug the error you are saying there is with auto-py-to-exe.

I would rather that you put the script here as it relates directly to this GitHub issue you have created.

<!-- gh-comment-id:500199071 --> @brentvollebregt commented on GitHub (Jun 9, 2019): No, I only want a **small snippet** of your code (like a proof of concept) so that I can package it and then execute the output to debug the error you are saying there is with auto-py-to-exe. I would rather that you put the script here as it relates directly to this GitHub issue you have created.
Author
Owner

@joker8989 commented on GitHub (Jun 9, 2019):

Ok i am goiing back home and i will upload my script in like 2-3 hours

<!-- gh-comment-id:500200736 --> @joker8989 commented on GitHub (Jun 9, 2019): Ok i am goiing back home and i will upload my script in like 2-3 hours
Author
Owner

@joker8989 commented on GitHub (Jun 10, 2019):

Ok so i ran some tests and at the first time since we spoke the convertion was successful but the file could not been executed cause "No module named Math" with capital M is this a issue that u familiar with? or..

Screenshot (86)

i dont know how to resolve it for now but after that i will post the real problem with exec() command that probably won't work but the file was converted to exe so... that's a start :)

thankx for your support

<!-- gh-comment-id:500362419 --> @joker8989 commented on GitHub (Jun 10, 2019): Ok so i ran some tests and at the first time since we spoke the convertion was successful but the file could not been executed cause "No module named Math" with capital M is this a issue that u familiar with? or.. ![Screenshot (86)](https://user-images.githubusercontent.com/35543679/59188177-bb3dae80-8b7f-11e9-852c-5ef7daf11d89.png) i dont know how to resolve it for now but after that i will post the real problem with exec() command that probably won't work but the file was converted to exe so... that's a start :) thankx for your support
Author
Owner

@brentvollebregt commented on GitHub (Jun 10, 2019):

Have you actually run this code in Python? There is no module named Math in the Python standard library and there is also no module named Math on PyPI so I am going to have to assume that Math is a custom module you made, thus you need to import it correctly.

<!-- gh-comment-id:500363224 --> @brentvollebregt commented on GitHub (Jun 10, 2019): Have you actually run this code in Python? There is no module named `Math` in the Python standard library and there is also no module named `Math` on PyPI so I am going to have to assume that `Math` is a custom module you made, thus you need to import it correctly.
Author
Owner

@joker8989 commented on GitHub (Jun 10, 2019):

No its not i installed your program with pip install auto-py-to-exe
and run in the cmd auto-py-to-exe.... that;s it i dont have module Math at all
i know there is no module Math in python (math includes in python lib)
so i will setup a VM and run some tests on it and let u know :)

<!-- gh-comment-id:500379198 --> @joker8989 commented on GitHub (Jun 10, 2019): No its not i installed your program with pip install auto-py-to-exe and run in the cmd auto-py-to-exe.... that;s it i dont have module Math at all i know there is no module Math in python (math includes in python lib) so i will setup a VM and run some tests on it and let u know :)
Author
Owner

@brentvollebregt commented on GitHub (Jun 10, 2019):

Right, sorry, I had assumed it was your application as you have covered up half the terminal with a completed package in auto-py-to-exe.

Could you supply the error here (copy and paste). This looks like an issue with the "Open Output Folder" button call; did you click this when the error occurred? Would be good to know this.

<!-- gh-comment-id:500380458 --> @brentvollebregt commented on GitHub (Jun 10, 2019): Right, sorry, I had assumed it was your application as you have covered up half the terminal with a completed package in auto-py-to-exe. Could you supply the error here (copy and paste). This looks like an issue with the "Open Output Folder" button call; did you click this when the error occurred? Would be good to know this.
Author
Owner

@joker8989 commented on GitHub (Jun 10, 2019):

It seems something went wrong with the file i created (although the file works fine) there is no error
"No module named Math" anymore
but the rest of the error still appears from the above screenshot (line 766) /src/gevenet/greenlet.py ......
can't open the file location from "open output folder"
(maybe that's the error above have not look at this yet)

again let me run some tests i have win 10 VB installed i will try in an hour and let u know..
maybe its a BUG or something is wrong with this specific virtual machine(cause i had some issues with this VM i dont know if it has any connection with auto-py-to-exe)

<!-- gh-comment-id:500389848 --> @joker8989 commented on GitHub (Jun 10, 2019): It seems something went wrong with the file i created (although the file works fine) there is no error "No module named Math" anymore but the rest of the error still appears from the above screenshot (line 766) /src/gevenet/greenlet.py ...... can't open the file location from "open output folder" (maybe that's the error above have not look at this yet) again let me run some tests i have win 10 VB installed i will try in an hour and let u know.. maybe its a BUG or something is wrong with this specific virtual machine(cause i had some issues with this VM i dont know if it has any connection with auto-py-to-exe)
Author
Owner

@brentvollebregt commented on GitHub (Jun 10, 2019):

Could you please paste the error here? Also did you click on the "Open Output Folder" button for this to occur.

<!-- gh-comment-id:500390543 --> @brentvollebregt commented on GitHub (Jun 10, 2019): Could you please paste the error here? Also did you click on the "Open Output Folder" button for this to occur.
Author
Owner

@joker8989 commented on GitHub (Jun 10, 2019):

Yes i press the "Open Output Folder" and then the error occurs ...
this is what i have just tested:
no exec command a simple script..

Screenshot (89)

Well it seems the exec() command is not "The problem" i tested a simple script by the screenshot above with Onefile & Noconsole (hidden console) and the script could not be executed..
i tried with console(show console) the console appears asks me to "enter:" something and when i do it,
its quickly exit the console and i cant even see the "print" command in action (not showing me the output from the input i entered)

i got to go now i will be back and keep testing it..

<!-- gh-comment-id:500400941 --> @joker8989 commented on GitHub (Jun 10, 2019): Yes i press the "Open Output Folder" and then the error occurs ... this is what i have just tested: no exec command a simple script.. ![Screenshot (89)](https://user-images.githubusercontent.com/35543679/59195402-90118a00-8b94-11e9-9b27-9fdbc050b6af.png) Well it seems the exec() command is not "The problem" i tested a simple script by the screenshot above with Onefile & Noconsole (hidden console) and the script could not be executed.. i tried with console(show console) the console appears asks me to "enter:" something and when i do it, its quickly exit the console and i cant even see the "print" command in action (not showing me the output from the input i entered) i got to go now i will be back and keep testing it..
Author
Owner

@brentvollebregt commented on GitHub (Jun 10, 2019):

Did you read the post that is linked at the end of every conversion? I wrote this to help debug situations exactly like this.

What do you actually believe is wrong with auto-py-to-exe? Also, as I asked twice previously, can you please paste the error here you get from pressing the "Open Output Folder" button.

<!-- gh-comment-id:500402611 --> @brentvollebregt commented on GitHub (Jun 10, 2019): Did you read the [post](https://nitratine.net/blog/post/issues-when-using-auto-py-to-exe/) that is linked at the end of **every** conversion? I wrote this to help debug situations exactly like this. What do you actually believe is wrong with auto-py-to-exe? Also, as I asked twice previously, can you please paste the error here you get from pressing the "Open Output Folder" button.
Author
Owner

@joker8989 commented on GitHub (Jun 11, 2019):

sorry for no being active for a long time even now i am leaving but you asked me to share the error code from the "Open Output Folder" so here it is:

Screenshot (92)

as u can see the Math module is not displays as error so it was a problem with the vm as i said..
i clicked twice "Open Output Folder" to u to see the error and figured it out

when i am back i read your post and continue testing it...

<!-- gh-comment-id:500730777 --> @joker8989 commented on GitHub (Jun 11, 2019): sorry for no being active for a long time even now i am leaving but you asked me to share the error code from the "Open Output Folder" so here it is: ![Screenshot (92)](https://user-images.githubusercontent.com/35543679/59253599-4463ec80-8c37-11e9-9be0-6f846c4753df.png) as u can see the Math module is not displays as error so it was a problem with the vm as i said.. i clicked twice "Open Output Folder" to u to see the error and figured it out when i am back i read your post and continue testing it...
Author
Owner

@brentvollebregt commented on GitHub (Jun 11, 2019):

Thank you, I now see what this error is. The function os.startfile in Python 2.7 does not take the keyword operation; it is suppose to be a positional argument. The error is:

TypeError: startfile() takes no keyword arguments
<!-- gh-comment-id:500739409 --> @brentvollebregt commented on GitHub (Jun 11, 2019): Thank you, I now see what this error is. The function `os.startfile` in Python 2.7 does not take the keyword `operation`; it is suppose to be a positional argument. The error is: ``` TypeError: startfile() takes no keyword arguments ```
Author
Owner

@brentvollebregt commented on GitHub (Jun 11, 2019):

I have just fixed this issue. If you now pull down master and run auto-py-to-exe, you should no longer get this issue. Tested in Python 2.7 and 3.5 on Windows 10.

If this works, I can deploy to PyPI some time in the next couple of days.

<!-- gh-comment-id:500749197 --> @brentvollebregt commented on GitHub (Jun 11, 2019): I have just fixed this issue. If you now pull down master and run auto-py-to-exe, you should no longer get this issue. Tested in Python 2.7 and 3.5 on Windows 10. If this works, I can deploy to PyPI some time in the next couple of days.
Author
Owner

@brentvollebregt commented on GitHub (Jun 11, 2019):

Sorry, forgot that keyword in the commit closes a issue.

Could you please run the latest version on master to check that this has now been fixed? Thank you very much for your time.

<!-- gh-comment-id:500800964 --> @brentvollebregt commented on GitHub (Jun 11, 2019): Sorry, forgot that keyword in the commit closes a issue. Could you please run the latest version on master to check that this has now been fixed? Thank you very much for your time.
Author
Owner

@joker8989 commented on GitHub (Jun 11, 2019):

Yes i can confirm it is working from the Master pack there is no error on CMD and the button opens me the output folfer
good job! 👍

i think you should upload it to pypi it is more easier to install (1 command - for others)

<!-- gh-comment-id:500827509 --> @joker8989 commented on GitHub (Jun 11, 2019): Yes i can confirm it is working from the Master pack there is no error on CMD and the button opens me the output folfer good job! :+1: i think you should upload it to pypi it is more easier to install (1 command - for others)
Author
Owner

@joker8989 commented on GitHub (Jun 11, 2019):

leading to my problem (not the main problem(exec)) the aa.py file that i posted above that there is a fatal error
with the

x = raw_input("enter something")
print x
input() <-- Added for debugging and used console based

i see that the file works fine in Idle i am using auto-py-to-exe with console based to see if the file can be converted and no error is occurred i removed the debugging (i tried even without debugging the script worked) and when i'm trying the windows based(hidden console) the Fatal error occurs and can't execute the exe file..

<!-- gh-comment-id:500834988 --> @joker8989 commented on GitHub (Jun 11, 2019): leading to my problem (not the main problem(exec)) the aa.py file that i posted above that there is a fatal error with the x = raw_input("enter something") print x input() <-- Added for debugging and used console based i see that the file works fine in Idle i am using auto-py-to-exe with console based to see if the file can be converted and no error is occurred i removed the debugging (i tried even without debugging the script worked) and when i'm trying the windows based(hidden console) the Fatal error occurs and can't execute the exe file..
Author
Owner

@brentvollebregt commented on GitHub (Jun 11, 2019):

After every build in auto-py-to-exe there is a link that appears that the bottom of the UI directing users to a post I wrote if they are having issues. I recommend reading this, specifically the header Fatal Error: failed to execute.

This will help you find the real error that is occurring.

<!-- gh-comment-id:500971810 --> @brentvollebregt commented on GitHub (Jun 11, 2019): After every build in auto-py-to-exe there is a link that appears that the bottom of the UI directing users to a post I wrote if they are having issues. I recommend reading this, specifically the header [Fatal Error: failed to execute](https://nitratine.net/blog/post/issues-when-using-auto-py-to-exe/#fatal-error-failed-to-execute). This will help you find the real error that is occurring.
Author
Owner

@joker8989 commented on GitHub (Jun 12, 2019):

I tried debugging the issue with this simple script (aa.py) no debug was displayed i dont know if its a bug or something else..
if u can please check it in your side if the file above is working or not (with onefile) with debugging and without..(debugging = with window console)

again in the debugging nothing was displayed the file was just regular executed i enter something and it showed the result

thankx for your time

<!-- gh-comment-id:501219750 --> @joker8989 commented on GitHub (Jun 12, 2019): I tried debugging the issue with this simple script (aa.py) no debug was displayed i dont know if its a bug or something else.. if u can please check it in your side if the file above is working or not (with onefile) with debugging and without..(debugging = with window console) again in the debugging nothing was displayed the file was just regular executed i enter something and it showed the result thankx for your time
Author
Owner

@brentvollebregt commented on GitHub (Jun 12, 2019):

Your snippet above doesn't run in Python (I'm assuming this is what you are asking me to test, there is no other code you have provided):

x = raw_input("enter something")
print x
input() # <-- Added for debugging and used console based

I tested this with Python 2 and input() raised a SyntaxError: invalid syntax as expected because Python 2 does not support input() (it's Python 3 syntax).

<!-- gh-comment-id:501224053 --> @brentvollebregt commented on GitHub (Jun 12, 2019): Your snippet above doesn't run in Python (I'm assuming this is what you are asking me to test, there is no other code you have provided): ```python x = raw_input("enter something") print x input() # <-- Added for debugging and used console based ``` I tested this with Python 2 and `input()` raised a `SyntaxError: invalid syntax` as expected because Python 2 does not support `input()` (it's Python 3 syntax).
Author
Owner

@joker8989 commented on GitHub (Jun 12, 2019):

sorry for editing i have just tested it again the file runs the code and then raised the error yes u right but that's not an excuse why the program aa.py does not work :(
cause the program above does not have input()
the code is just:
func name:
x = raw_input("enter: ")
print x

test it with onefile(console hidden) the file will get fatal error and cant be executed
yes u right if u put the input() u will get an error... but remove the input and see the result with debugging without debuuging with console without console

<!-- gh-comment-id:501236835 --> @joker8989 commented on GitHub (Jun 12, 2019): sorry for editing i have just tested it again the file runs the code and then raised the error yes u right but that's not an excuse why the program aa.py does not work :( cause the program above does not have input() the code is just: func name: x = raw_input("enter: ") print x test it with onefile(console hidden) the file will get fatal error and cant be executed yes u right if u put the input() u will get an error... but remove the input and see the result with debugging without debuuging with console without console
Author
Owner

@brentvollebregt commented on GitHub (Jun 12, 2019):

Did you read the post that I linked you? If so, what is appearing in the output? If you're getting a dialog displaying "fatal error" then there will be an error printed to stdout.

<!-- gh-comment-id:501239306 --> @brentvollebregt commented on GitHub (Jun 12, 2019): Did you read the post that I linked you? If so, what is appearing in the output? If you're getting a dialog displaying "fatal error" then there will be an error printed to stdout.
Author
Owner

@joker8989 commented on GitHub (Jun 12, 2019):

I dont know if u understand what i am trying solve
again i dont see any output errors maybe if u check this out u will understand if u do so well.. id ont know why casue when i try with console based(with debugging and without) no errors are appeared but its only when i try to run it from windows based(without console) so when i run the file from cmd or by clicking on it the error above is displayed
"Fatal error detected"
"Failed to execute script aa"

if u could provide a screen shot what do u see maybe it will solve the problem and i will figure it out

<!-- gh-comment-id:501252968 --> @joker8989 commented on GitHub (Jun 12, 2019): I dont know if u understand what i am trying solve again i dont see any output errors maybe if u check this out u will understand if u do so well.. id ont know why casue when i try with console based(with debugging and without) no errors are appeared but its only when i try to run it from windows based(without console) so when i run the file from cmd or by clicking on it the error above is displayed "Fatal error detected" "Failed to execute script aa" if u could provide a screen shot what do u see maybe it will solve the problem and i will figure it out
Author
Owner

@brentvollebregt commented on GitHub (Jun 12, 2019):

I created a script with the contents below:

x = input('Enter: ')
print(x)

When running this with Python 3, it asks for my input and prints it back out (as expected).

I then packaged the exe to an executable by using auto-py-to-exe with the only setting being changed being "Console Window" set to "Window Based (hide the console)".

Opening cmd and executing this, it shows a dialog with the message Failed to execute script [script name]. When double clicking, this occurs again. Yes, you are correct.

So here is my explanation as to why this does not work; ask yourself, where is the input call meant to get the input from and the print call output to? You just disabled console window from appearing, so what can Python use to execute these commands?

The answer is nothing, you have deprived the script of components required to execute and thus the script crashes.

This deprivation can be shown if you execute the script with something like git bash as git bash supplies the required components. I however do not recommend you rely on this, if you want to make a functional application, allow a console window to appear.

<!-- gh-comment-id:501258366 --> @brentvollebregt commented on GitHub (Jun 12, 2019): I created a script with the contents below: ```python x = input('Enter: ') print(x) ``` When running this with Python 3, it asks for my input and prints it back out (as expected). I then packaged the exe to an executable by using auto-py-to-exe with the only setting being changed being "Console Window" set to "Window Based (hide the console)". Opening cmd and executing this, it shows a dialog with the message `Failed to execute script [script name]`. When double clicking, this occurs again. Yes, you are correct. So here is my explanation as to why this does not work; ask yourself, where is the `input` call meant to get the input from and the `print` call output to? You just disabled console window from appearing, so what can Python use to execute these commands? The answer is nothing, you have deprived the script of components required to execute and thus the script crashes. > This deprivation can be shown if you execute the script with something like git bash as git bash supplies the required components. I however do not recommend you rely on this, if you want to make a functional application, allow a console window to appear.
Author
Owner

@brentvollebregt commented on GitHub (Jun 12, 2019):

If you feel this situation I have mentioned is a bug, bring it up with pyinstaller, as this occurs in the packaging process (because you have disabled the console - it did what you asked).

<!-- gh-comment-id:501259682 --> @brentvollebregt commented on GitHub (Jun 12, 2019): If you feel this situation I have mentioned is a bug, bring it up with [pyinstaller](https://github.com/pyinstaller/pyinstaller), as this occurs in the packaging process (because you have disabled the console - it did what you asked).
Author
Owner

@joker8989 commented on GitHub (Jun 13, 2019):

Well yea this explanation ran in my mind but wanted to ignore it, hoped its still possible. thankx for the clear explanation and your great support :)

I will keep testing this project
And if i find something i will let u know

<!-- gh-comment-id:501551846 --> @joker8989 commented on GitHub (Jun 13, 2019): Well yea this explanation ran in my mind but wanted to ignore it, hoped its still possible. thankx for the clear explanation and your great support :) I will keep testing this project And if i find something i will let u know
Author
Owner

@brentvollebregt commented on GitHub (Jun 13, 2019):

As described in my explanation, it is possible to make this work; do not disable the console. If you don't disable the console, then Python will have somewhere to read for input() and output for print and your example will work.

<!-- gh-comment-id:501552844 --> @brentvollebregt commented on GitHub (Jun 13, 2019): As described in my explanation, it is possible to make this work; do not disable the console. If you don't disable the console, then Python will have somewhere to read for `input()` and output for `print` and your example will work.
Author
Owner

@joker8989 commented on GitHub (Jun 13, 2019):

yea understood thankx .... just 1 question if i use pyinstaller/auto py to
exe on linux for example ubuntu/mint/debian i won't be able to run this on
windows right? cause linux does not have the win32 API ths files that do
most of the errors: win32com,win32api....
?
thankx again

http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail
Virus-free.
www.avg.com
http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Thu, Jun 13, 2019 at 8:21 AM Brent Vollebregt notifications@github.com
wrote:

Closed #58 https://github.com/brentvollebregt/auto-py-to-exe/issues/58.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/brentvollebregt/auto-py-to-exe/issues/58?email_source=notifications&email_token=AIPFU77GGH4CZS6NAQ2H5ODP2HKPPA5CNFSM4HVWCPFKYY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOR6OG73Q#event-2409394158,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AIPFU7ZPSPEX63MXGXNLXU3P2HKPPANCNFSM4HVWCPFA
.

<!-- gh-comment-id:501828432 --> @joker8989 commented on GitHub (Jun 13, 2019): yea understood thankx .... just 1 question if i use pyinstaller/auto py to exe on linux for example ubuntu/mint/debian i won't be able to run this on windows right? cause linux does not have the win32 API ths files that do most of the errors: win32com,win32api.... ? thankx again <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> Virus-free. www.avg.com <http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> On Thu, Jun 13, 2019 at 8:21 AM Brent Vollebregt <notifications@github.com> wrote: > Closed #58 <https://github.com/brentvollebregt/auto-py-to-exe/issues/58>. > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > <https://github.com/brentvollebregt/auto-py-to-exe/issues/58?email_source=notifications&email_token=AIPFU77GGH4CZS6NAQ2H5ODP2HKPPA5CNFSM4HVWCPFKYY3PNVWWK3TUL52HS4DFWZEXG43VMVCXMZLOORHG65DJMZUWGYLUNFXW5KTDN5WW2ZLOORPWSZGOR6OG73Q#event-2409394158>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/AIPFU7ZPSPEX63MXGXNLXU3P2HKPPANCNFSM4HVWCPFA> > . >
Author
Owner

@brentvollebregt commented on GitHub (Jun 13, 2019):

Stated in the pyinstaller GitHub Wiki:

Can I package Windows binaries while running under Linux?
No, this is not supported. Please use Wine for this, PyInstaller runs fine in Wine. You may also want to have a look at this thread in the mailinglist. In version 1.4 we had build in some support for this, but it showed to work only half. It would require some Windows system on another partition and would only work for pure Python programs. As soon as you want a decent GUI (gtk, qt, wx), you would need to install Windows libraries anyhow. So it's much easier to just use Wine.

<!-- gh-comment-id:501904874 --> @brentvollebregt commented on GitHub (Jun 13, 2019): Stated in the [pyinstaller GitHub Wiki](https://github.com/pyinstaller/pyinstaller/wiki/FAQ#features): > **Can I package Windows binaries while running under Linux?** > No, this is not supported. Please use Wine for this, PyInstaller runs fine in Wine. You may also want to have a look at this thread in the mailinglist. In version 1.4 we had build in some support for this, but it showed to work only half. It would require some Windows system on another partition and would only work for pure Python programs. As soon as you want a decent GUI (gtk, qt, wx), you would need to install Windows libraries anyhow. So it's much easier to just use Wine.
Author
Owner

@joker8989 commented on GitHub (Jun 14, 2019):

Sorry for being annoyin but does pyintstaller/auto py to exe support encryption? cause what i was telling u before that the exec does not work well it works :) but when i tried to encrypt my file and run it with pyinstaler/auto py to exe the Math module appears again :(
i use AES for encryption..
when i encrypt my py file i can still able to run it (the problem is to convert it to exe)
no errors was displayed except "no module named Math"
maybe back then i tried to convert encrypted code and that's why i got Math module that we did know what the hell is that..

anyway does it support encryption?

<!-- gh-comment-id:502068692 --> @joker8989 commented on GitHub (Jun 14, 2019): Sorry for being annoyin but does pyintstaller/auto py to exe support encryption? cause what i was telling u before that the exec does not work well it works :) but when i tried to encrypt my file and run it with pyinstaler/auto py to exe the Math module appears again :( i use AES for encryption.. when i encrypt my py file i can still able to run it (the problem is to convert it to exe) no errors was displayed except "no module named Math" maybe back then i tried to convert encrypted code and that's why i got Math module that we did know what the hell is that.. anyway does it support encryption?
Author
Owner

@brentvollebregt commented on GitHub (Jun 14, 2019):

That explanation is far beyond me... Not quite sure if that was a tangent or relevant. Never the less, what you are looking for in in pyinstaller's documentation:

To encrypt the Python bytecode modules stored in the bundle, pass the --key=key-string argument on the command line.
For this to work, you must have the PyCrypto module installed. The key-string is a string of 16 characters which is used to encrypt each file of Python byte-code before it is stored in the archive inside the executable file.

Might pay to know that PyCrypto is no longer maintained (it's been 5 years since it was touched) and has some nasty bugs/vulnerabilities in it. I imagine the functions pyinstaller uses may be ok though.

Also might pay to simply search "pyinstaller encryption" in Google next time.

<!-- gh-comment-id:502070582 --> @brentvollebregt commented on GitHub (Jun 14, 2019): That explanation is far beyond me... Not quite sure if that was a tangent or relevant. Never the less, what you are looking for in in [pyinstaller's documentation](https://pyinstaller.readthedocs.io/en/v3.3.1/usage.html#encrypting-python-bytecode): > To encrypt the Python bytecode modules stored in the bundle, pass the --key=key-string argument on the command line. > For this to work, you must have the [PyCrypto](https://pypi.python.org/pypi/pycrypto/) module installed. The key-string is a string of 16 characters which is used to encrypt each file of Python byte-code before it is stored in the archive inside the executable file. Might pay to know that PyCrypto is no longer maintained (it's been 5 years since it was touched) and has some nasty bugs/vulnerabilities in it. I imagine the functions pyinstaller uses may be ok though. Also might pay to simply search "pyinstaller encryption" in Google next time.
Author
Owner

@joker8989 commented on GitHub (Jun 14, 2019):

Did not fully understand what you mean? The key the pyinstaller offers i am
familiar with that.. but i wanted to make my own 1 inside their's key..
(Also i heard that doing "reverse engineerng" with an encrypted file that
touched the function --key of pyinstaller is very easy that's why i wanted
to make a "backup" And protect my code as possible..
U r saying pycrypto does not "exist" anymore but pyinstaller uses that? Did
not fully understand..
Also it does not solve the Math module that for me is not related to my
code or anything else..

<!-- gh-comment-id:502080946 --> @joker8989 commented on GitHub (Jun 14, 2019): Did not fully understand what you mean? The key the pyinstaller offers i am familiar with that.. but i wanted to make my own 1 inside their's key.. (Also i heard that doing "reverse engineerng" with an encrypted file that touched the function --key of pyinstaller is very easy that's why i wanted to make a "backup" And protect my code as possible.. U r saying pycrypto does not "exist" anymore but pyinstaller uses that? Did not fully understand.. Also it does not solve the Math module that for me is not related to my code or anything else..
Author
Owner

@brentvollebregt commented on GitHub (Jun 14, 2019):

You can't make your own encryption in their key; that doesn't make sense. I think you're asking how to encrypt your executable using other methods; if that is the case, that is fully up to you on how you do it.

PyCrypto does exist and PyInstaller still uses it, but it is now un-maintained. Yes, reverse engineering this encryption/decryption process is not difficult as the source is publicly available.

I don't believe the errors regarding the Math module have anything to do with the Math module as we proved before.

<!-- gh-comment-id:502084277 --> @brentvollebregt commented on GitHub (Jun 14, 2019): You can't make your own encryption in their key; that doesn't make sense. I think you're asking how to encrypt your executable using other methods; if that is the case, that is fully up to you on how you do it. PyCrypto does exist and PyInstaller still uses it, but it is now un-maintained. Yes, reverse engineering this encryption/decryption [process is not difficult as the source is publicly available](https://stackoverflow.com/a/39559759). I don't believe the errors regarding the Math module have anything to do with the Math module as we proved [before](https://github.com/brentvollebregt/auto-py-to-exe/issues/58#issuecomment-500739409).
Author
Owner

@joker8989 commented on GitHub (Jun 14, 2019):

I ran some test and i found something.. Crypto.Cipher is no longer suppored to work on pyinstaller that;s why i got the error(dont know why "No module named Math")
BUTTTTTT
pycryptodome is the enhanced version of crypto from what i understood so basically it works for me :)
I did not test it on my project(not yet) but i made new file and convert it with the AES and i am able to run it without problem with auto_py_to_exe :)
if u want to improve your project that but i dont know how many people do what i am doing so... your choise :)
(They can still pip the module on their own)

<!-- gh-comment-id:502112431 --> @joker8989 commented on GitHub (Jun 14, 2019): I ran some test and i found something.. Crypto.Cipher is no longer suppored to work on pyinstaller that;s why i got the error(dont know why "No module named Math") BUTTTTTT pycryptodome is the enhanced version of crypto from what i understood so basically it works for me :) I did not test it on my project(not yet) but i made new file and convert it with the AES and i am able to run it without problem with auto_py_to_exe :) if u want to improve your project that but i dont know how many people do what i am doing so... your choise :) (They can still pip the module on their own)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/auto-py-to-exe#55
No description provided.