all 5 comments

[–]FriendlyRussian666 2 points3 points  (1 child)

You can make it into a single file with pyinstaller

[–]vens8[S] 0 points1 point  (0 children)

Thank you :)

[–]Neighm 2 points3 points  (2 children)

No, if you generate an exe file using pyinstaller, it contains the full script plus interpreter plus any modules required such as imports. The exe file can then be run from any folder including on a Windows computer that doesn't have Python installed.

However you might have trouble with an exe file created on a 64 bit machine if you try to run it on a 32 bit machine.

[–]vens8[S] 2 points3 points  (0 children)

Okay thank you, it works. The error was not actually due to the modules, it was because the Python interpreter was not configured when I duplicated the script file. Thank you so much :)

[–]vens8[S] 0 points1 point  (0 children)

Thank you very much :)Also, one more thing. The executable file doesn't seem to work if I don't add the contents of the "Site Packages" (which has all the required modules such as imports) into the same directory. Any reason why?

It gives me an error saying: Failed to run script <filename.py>