0

My script is not working after converting to EXE, it says failed to execute script, it has some external files in the same directory but it works as script but not as exe. It started give me this error since I Added a video with moviepy to the beginning as splash screen.

EDIT: I got this in cmd while converting: c:\python\python39\lib\site-packages\moviepy\video\io\sliders.py:61: SyntaxWarning: "is" with a literal. Did you mean "=="? if event.key is 'enter':

Or maybe it's because there are some modules that I don't have that are being imported in the module's scripts?

2 Answers2

0

Try adding the whole path instead of just having all the files in the same directory for example "D:\myfile\video.mp4" instead of "video.mp4"

Angelo
  • 122
  • 1
  • 10
0

SyntaxWarning: "is" with a literal.

This is a warning added in Python 3.8

The compiler now produces a SyntaxWarning when identity checks (is and is not) are used with certain types of literals (e.g. strings, numbers). These can often work by accident in CPython, but are not guaranteed by the language spec. The warning advises users to use equality tests (== and !=) instead. (Contributed by Serhiy Storchaka in bpo-34850.)

This usually appears when you are using is in your code since Python 3.8. You can try to replace the is into == and recompile it into exe and try again. which means change

if event.key is 'enter'

to

if event.key == 'enter'

is checks for identity - if the two variables point to the exact same object.

== checks for equality - if the two variables point at values are equal. That is, if they will act the same way in the same situations.

Zichzheng
  • 1,090
  • 7
  • 25