cx_Freeze
cx_Freeze copied to clipboard
Frozen PySide6 sample not working on other PC
Hello,
I can successfully freeze and run the PySide6-SimpleBrowser example on my PC. However, when I copy the frozen app to another (non developer) PC I get an error. I have the same error with my actual project - hoping for a quick resolution, its blocking my next release.
cx_freeze 3.12.0.dev1 PySide6 6.2.4 (same issue 6.3.1)
Error:
Traceback (most recent call last):
File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\cx_Freeze\initscripts_startup_.py", line 120, in run
File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\cx_Freeze\initscripts\console.py", line 16, in run
File "simplebrowser.py", line 5, in
Please check the FAQ.
Hi, I built again with include_msvcr and verified that the dll is included. I still get an error on the other PC, it changed slightly though.
PySide6/init.py: Unable to import Shiboken from C:\Users\User\Desktop\build\exe.win-amd64-3.7\lib\library.zip, C:\Users\User\Desktop\build\exe.win-amd64-3.7\lib
Traceback (most recent call last):
File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\cx_Freeze\initscripts_startup_.py", line 120, in run
File "C:\Users\User\AppData\Roaming\Python\Python37\site-packages\cx_Freeze\initscripts\console.py", line 16, in run
File "simplebrowser.py", line 5, in
I then tried installing the c++ redist from the link of the FAQ. The installer wouldn't let me proceed because a newer version was already installed:
.
I found the issue: python3.dll and python37.dll need to be also present inside the lib folder. Then it works on other PCs too.
Sorry, I was too quick in closing this - I still had the workaround of copying the python dlls to lib in my buildscript. The problem still exists with cx_freeze 6.12.
Can you show me the original contents of the build/exe.win-amd64-3.7 folder and the lib? Actually, I think that if you copy vcruntime* to exe.win-amd64-3.7 also solves. Can you test this?
The vcruntime already is contained in the build root and another copy in the lib folder. Here are the contents of the build root /lib and /lib/PySide6 dirs (of my project, not the sample)
@brzGatsu With my samples I cannot reproduce the error. So, I used the Sephrasto. I commented the 2 lines: https://github.com/Aeolitus/Sephrasto/blob/master/src/Sephrasto/CxFreezeBuild.py#L73-L74 Copied the zip to a cleaner machine. It works! I used python 3.7.9 to build, cx_Freeze 6.12, PySyde6 6.3.2 In my virtualenv is installed strictly the requirements and the requirements of cx_Freeze. I see that in your environment there seem to be other packages like pywin32 (win32api.pyd, win32evtlog.pyd, _win32sysloader.pyd). Try without these packages as they are not required.
Hello,
thank you for checking this out. You're right, I had some unneeded packages in my env and now set it up according to the requirements.txt. However, the issue is not resolved with that - I retried both Sephrasto and the SimpleBrowser example on a regularily used PC that has no python installed as well as on a freshly installed bare-bones Win 10 PC. The python dlls still need to be copied to the lib folder for the apps to work on either machine.
I added the contents of the SimpleBrowser build root and lib folders root.txt
I used python 3.7.9 to build, cx_Freeze 6.12, PySyde6 6.3.2, and you?
Python 3.7.8, cx_Freeze 6.12 and PySide6 6.3.2
Since this seems to be a path issue, maybe the reason is that I use Visual Studios python installation? (I have the following folder in my env path for using python: C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64)
The bug is with Python 3.7.8 Similar issue #1408 (see my last comment). More info: https://bugs.python.org/issue29778#msg373164
To install the latest development build:
pip install --pre --extra-index-url https://marcelotduarte.github.io/packages/ cx_Freeze
cx_Freeze 6.13.0 has just been released.
Thank you very much! It is fixed now!