CX_Freeze exe references old pyc file?

Viewed 147

I have built a Cx Freeze exe from python code. Code worked fine. I recently modified one .py file and rebuilt the exe. Dragged the entire build directory over to another computer for use and it looked as though it was using an older version of the code. Rebuilt, retried. Same thing.

Ended up moving over the new updated python file to the other computer and the exe starts working correctly.

Looks like the exe is not truly independent of the uncompiled code?

Have any of you seen this? Is it a bug? Is there a fix? thanks!!

1 Answers

I had this same issue and found some troubleshooting steps to fix the problem:

  1. Change the version number in setup.py.
  2. Change the name of the init.py (or whatever your first file is called.) Change the name in setup.py to match.
  3. Copy your files into a separate folder along with the setup.py and rerun there.
Related