navicore
navicore

Reputation: 2119

cxfreeze can't find libpyside-python

Running cxfreeze 4.2.3 on osx 10.7 with pyside 1.1.0 i get:

copying libpyside-python2.7.1.1.dylib -> build/exe.macosx-10.7-intel-2.7/libpyside-python2.7.1.1.dylib error: libpyside-python2.7.1.1.dylib: No such file or directory

It found the PySide module no problem in the output:

copying /Library/Python/2.7/site-packages/PySide/QtCore.so -> build/exe.macosx-10.7-intel-2.7/PySide.QtCore.so

Using osx's python2.7 and no MacPorts installed

Upvotes: 2

Views: 1227

Answers (1)

dmccombs
dmccombs

Reputation: 21

This happens because cx_Freeze takes the output of libraries from otool -L and uses it as the absolute path to copy the library from.

In my case this was a problem because the libraries are in a virtual environment that's different on each machine, and cx_Freeze would then fail to find the libraries. You can fix this using the install_name_tool command to replace the path. I have my project's bootstrap script set up to scan all .so or .dylib files for libraries that exist within the virtual environment, and swap out the paths.

To manually do this it's:

otool -L /Library/Python/2.7/site-packages/PySide/QtCore.so
install_name_tool -change "<path listed for libpyside above>" "<actual path to libpyside" /Library/Python/2.7/site-packages/PySide/QtCore.so

Be careful doing this for a global file like that, you're probably better having things in a virtualenv environment.

Upvotes: 2

Related Questions