cx_Freeze 4.3.3 : ImportError: No such file or directory

Hi there,

I’m trying to create a binary file with cx_Freeze 4.3.3 on openSuse 42.1 (I use wxPython3.0), but on an empty openSuse system, I can’t run my program…

When I try to run my binary program on an empty system opensuse (without wxPython installed on it), I get this error :

Traceback(most recent call last):
File"/usr/lib64/python2.7/site-packages/cx_Freeze/initscripts/", line 27,in<module>
File"", line 4,in<module>
File"/usr/lib64/python2.7/site-packages/wx-3.0-gtk2/wx/", line 45,in<module>
File"/usr/lib64/python2.7/site-packages/wx-3.0-gtk2/wx/", line 4,in<module>
.py", line 22,in<module>
File"", line 14,in bootstrap
ImportError: cannot open shared object file:No such file or directory

But that file “” is indeed at root of the directory containing the binaries files :

-rwxrwx—1 regis users 191896025 oct.2015
-rwxrwx—1 regis users 57552825 oct.2015
-rwxrwx—1 regis users 578064025 oct.2015

Any idea on what’s going on ?

Note :
when generating binaries files with cx_Freeze 4.3.3, I had warnings about “lib-dynload”, because in the directory /usr/lib64/python2.7/lib-dynload all the files can’t be executed.
I tried to put all these files with execution rights with chmod command, but the probleme remains…

I don’t really understand what the directory lib-dynload is usefull for ? It seems contain base libraries?..

Thx a lot

By the way,
here is my file :

import sys
from cx_Freeze import setup,Executable

path = sys.path
path +="/usr/lib64"]

includes =]
excludes =‘PyQt4’,‘PyQt5’,‘Tkinter’,‘FixTk’,‘tcl’,‘tk’,’_tkinter’,‘’]
packages =‘matplotlib.backends.backend_wxagg’,‘numpy’]

includefiles =’./data/’,’./images/’,’./html/’,’./locale/’,’./logs/’]

binpathincludes =]

if sys.platform ==“linux2”:
binpathincludes +="/usr/lib64"]
binpathincludes +="/usr/lib"]

base =‘Console’

options ={“path”: path,
“includes”: includes,
“excludes”: excludes,
“packages”: packages,
“include_files”: includefiles,
“bin_path_includes”: binpathincludes,

executables =
Executable(‘’, base=base)

description=‘My Project’,
options={‘build_exe’: options}

If you’re developing on your machine,
You should either install Python3 from the official Python repo or
Add the special openSUSE 42.3 Python repo as follows, then update your system with the new packages

zypper ar -f LEAP_42.3_devel:Python3

Then update your system

zypper up

Then, try building again.
In general, they libraries in a default install are sufficient to run most apps, but if you do any coding you should always install the special repo for that language.


Thanks for your answer TSU.

Sorry to reply with delay, but I wanted to have time to investigate on my side.
I have yet developed my program with python2.7, and don’t have time to adapt it to version 3.

So I tried to adapt your solution with that command :

zypper ar -f LEAP_42.3_devel:Python

Unfortunately, there was no file to update on my system… the problem was still present.

So I searched on the internet, and found out the " patchelf " command.
As my binary files (generated with cx_Freeze) were in the same directory than my executable file, I created the script :

for i in *so*
     patchelf --set-rpath '.' $i

Since, my standalone application can be launched on an “empty” openSuse system… rotfl!


  • this solution works with cx_Freeze 4.3.x, but don’t with the 5.x versions
  • I successfully created standalone application (for this same program) on various other linux platform (Debian, Mint, Ubuntu, Mageia, Fedora, CentOS) without any kind of problem.
    Only openSuse has needed this kind of operation so my standalone program can work out… I can’t explain why.

May be this post could help some else.

Thanks again TSU for your help. :wink: