Closed emign closed 2 years ago
1) Can you test the pyside6 sample?
2) What is your setup.py for your sample?
3) How to install the module qt
used in your sample?
Thank you for answering. The sample produces the same output. I did the following with the pyside6-sample you linked:
python3 -m venv ./venv
source venv/bin/activate
pip install pyside6
pip install cx_freeze
cxfreeze -c test_pyside6.py --target-dir dist
This is the output:
ERROR: Could not resolve RPath [@rpath/libpyside6.abi3.6.2.dylib] in file [/Users/username/Desktop/pyside-sample/venv/lib/python3.9/site-packages/PySide6/QtCore.abi3.so], and could not find any likely intended reference.
[0] File: /Users/username/Desktop/pyside-sample/venv/lib/python3.9/site-packages/PySide6/QtCore.abi3.so
Commands:
<MachOCommand (Load command 0 / cmd LC_SEGMENT_64)>
<MachOCommand (Load command 1 / cmd LC_SEGMENT_64)>
<MachOCommand (Load command 2 / cmd LC_SEGMENT_64)>
<MachOCommand (Load command 3 / cmd LC_SEGMENT_64)>
<MachOCommand (Load command 4 / cmd LC_DYLD_INFO_ONLY)>
<MachOCommand (Load command 5 / cmd LC_SYMTAB)>
<MachOCommand (Load command 6 / cmd LC_DYSYMTAB)>
<MachOCommand (Load command 7 / cmd LC_UUID)>
<MachOCommand (Load command 8 / cmd LC_BUILD_VERSION)>
<MachOCommand (Load command 9 / cmd LC_SOURCE_VERSION)>
<LoadCommand path='@rpath/libpyside6.abi3.6.2.dylib'>
<LoadCommand path='@rpath/libshiboken6.abi3.6.2.dylib'>
<LoadCommand path='@rpath/QtCore.framework/Versions/A/QtCore'>
<LoadCommand path='/System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration'>
<LoadCommand path='/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit'>
<LoadCommand path='/usr/lib/libc++.1.dylib'>
<LoadCommand path='/usr/lib/libSystem.B.dylib'>
<MachOCommand (Load command 17 / cmd LC_FUNCTION_STARTS)>
<MachOCommand (Load command 18 / cmd LC_DATA_IN_CODE)>
<MachOCommand (Load command 19 / cmd LC_CODE_SIGNATURE)>
<RPath path='@loader_path'>
<RPath path='@loader_path/Qt/lib'>
RPath commands:
<RPath path='@loader_path'>
<RPath path='@loader_path/Qt/lib'>
Calculated RPath:
/Users/username/Desktop/pyside-sample/venv/lib/python3.9/site-packages/PySide6/Qt/lib
Traceback (most recent call last):
File "/Users/username/Desktop/pyside-sample/venv/bin/cxfreeze", line 8, in <module>
sys.exit(main())
File "/Users/username/Desktop/pyside-sample/venv/lib/python3.9/site-packages/cx_Freeze/cli.py", line 365, in main
freezer.Freeze()
File "/Users/username/Desktop/pyside-sample/venv/lib/python3.9/site-packages/cx_Freeze/freezer.py", line 648, in Freeze
self._post_freeze_hook()
File "/Users/username/Desktop/pyside-sample/venv/lib/python3.9/site-packages/cx_Freeze/freezer.py", line 859, in _post_freeze_hook
self.darwinTracker.finalizeReferences()
File "/Users/username/Desktop/pyside-sample/venv/lib/python3.9/site-packages/cx_Freeze/darwintools.py", line 621, in finalizeReferences
raise DarwinException(
cx_Freeze.exception.DarwinException: finalizeReferences() failed to resolve path [@rpath/libpyside6.abi3.6.2.dylib] in file [/Users/username/Desktop/pyside-sample/venv/lib/python3.9/site-packages/PySide6/QtCore.abi3.so].
Same happens with python 3.10 btw:
cx_Freeze.exception.DarwinException: finalizeReferences() failed to resolve path [@rpath/libpyside6.abi3.6.2.dylib] in file [/Users/username/Desktop/pyside-sample/venv/lib/python3.10/site-packages/PySide6/QtCore.abi3.so].
Try the sample with the setup.py
python setup.py build
Another option is:
python setup.py bdist_mac
The same error occurs when doing that.
@emign Have you resolved this issue?
same issue for me using this setup on my mac. running python setup.py bdist_mac
`from cx_Freeze import setup, Executable
build_options = {'packages': ["shiboken6","PySide6"], 'excludes': []}
import sys base = 'Win32GUI' if sys.platform=='win32' else None
executables = [ Executable('main.py', base=base, target_name = 'app') ]
setup(name='app', version = '1.6', description = 'None yet', options = {'build_exe': build_options}, executables = executables) `
@emign I believe this issue is due to dots in the filename and pathlib not knowing how to handle such. https://stackoverflow.com/questions/54356159/how-to-deal-with-multiple-dots-in-a-file-name-with-python-pathlib
I'm reopening this issue since the author closed it without clarifying how he solved the problem and others continue to comment.
I made a patch to try to solve it. I used the pyside6 sample and got a result using GHA.
Please test:
pip install --pre --extra-index-url https://marcelotduarte.github.io/packages/ cx_Freeze
@marcelotduarte What version of PySide6 did you use?
Python 3.10.4 (main, May 4 2022, 08:44:58) [Clang 12.0.0 (clang-1200.0.32.29)]
Package Version Location Installer
------------------ ----------- ---------------------------------------------------------------------------- ---------
cx-Freeze 6.12.0.dev0 /Users/runner/hostedtoolcache/Python/3.10.4/x64/lib/python3.10/site-packages pip
packaging 21.3 /Users/runner/hostedtoolcache/Python/3.10.4/x64/lib/python3.10/site-packages pip
pip 22.1.1 /Users/runner/hostedtoolcache/Python/3.10.4/x64/lib/python3.10/site-packages pip
pyparsing 3.0.9 /Users/runner/hostedtoolcache/Python/3.10.4/x64/lib/python3.10/site-packages pip
PySide6 6.3.0 /Users/runner/hostedtoolcache/Python/3.10.4/x64/lib/python3.10/site-packages pip
PySide6-Addons 6.3.0 /Users/runner/hostedtoolcache/Python/3.10.4/x64/lib/python3.10/site-packages pip
PySide6-Essentials 6.3.0 /Users/runner/hostedtoolcache/Python/3.10.4/x64/lib/python3.10/site-packages pip
setuptools 60.10.0 /Users/runner/hostedtoolcache/Python/3.10.4/x64/lib/python3.10/site-packages pip
shiboken6 6.3.0 /Users/runner/hostedtoolcache/Python/3.10.4/x64/lib/python3.10/site-packages pip
I found out:
Create an venv
run pip install cx-freeze
run pip install -U git+https://github.com/marcelotduarte/cx_Freeze.git@refs/pull/887/head
then it will compile. I can install all my other needed libaries without any issue, and it compiles well.
However, as soon as I am installing python-opencv in the venv it throws this error:
„This may be caused by including modules in the zip file that rely on binary libaries with the same name“
@Lukikrew After v6.5.3 has too many changes. To help to solve this issue I need tests using binary wheels:
pip install --pre --extra-index-url https://marcelotduarte.github.io/packages/ cx_Freeze
or compiling from sources:
pip install -U git+https://github.com/marcelotduarte/cx_Freeze.git@develop
@marcelotduarte thank you, actually it works without any issues with the develop pip :)
To test the PR #1521 you can use the binary wheels:
pip install --pre --extra-index-url https://marcelotduarte.github.io/packages/ cx_Freeze
or compiling from sources:
pip install -U git+https://github.com/marcelotduarte/cx_Freeze.git@develop
For my tests in GHA it works very well. pyside6 sample works with bdist_mac and build_exe. It works for pyside2 too.
cx_Freeze 6.11.1 has just been released. pip install --upgrade cx_Freeze
Describe the bug
To Reproduce Just build this Qt6 App on my M1-Mac:
Desktop (please complete the following information):