Cx_freeze: Not a directory

I am trying to build a binary on Linux (Manjaro Linux, x86_64, python 3.4). My application is graphical software written with PyQt.

Here is my

import sys
import os
from cx_Freeze import setup, Executable

# GUI applications require a different base on Windows (the default is for a
# console application).
base = None
if sys.platform == "win32":
    base = "Win32GUI"

my_data_files = ["./images/", "./journals/", "./config/"]

# Dependencies are automatically detected, but it might need fine tuning.
build_exe_options = {"packages": ["os"],
                     "excludes": [
                     'includes': [
                     'include_files': my_data_files

setup(name = "guifoo",
      version = "0.1",
      description = "My GUI application!",
      options = {"build_exe": build_exe_options},
      executables = [Executable("", base=base)])


While I'm just getting started. The "includes" part in the option is what I used when I compiled my binary with py2exe (it worked, but I want a unique tool to be created for all platforms).

When I start compiling with

python build


everything works fine, but when I try to run the binary, I have this exception:

NotADirectoryError: [Errno 20] Not a directory: '/home/djipey/Desktop/test/build/exe.linux-x86_64-3.4/'


So, I guess I have a problem with the text_unidecode module, but I can't figure out what the problem is.

Could you give me your hand?


Okay, sorry for the lack of precision, I didn't copy / paste the entire error message:

File "/usr/lib/python3.4/site-packages/text_unidecode/", line 6, in <module>
    with open(_data_path, 'rb') as f:
NotADirectoryError: [Errno 20] Not a directory: '/home/djipey/Desktop/test/build/exe.linux-x86_64-3.4/'


I think the problem may be coming from text_unidecode, but I don't know why. I installed it without any problem on my computer. init .py

EDIT 2: If I integrate the text-unidecode (it's basically one function) into my own code, it works. I seem to know why I am having this problem. In text-unidecode, there is a file called data.bin that contains the data used by the text-unidecode function. It is part of the library, but it is not added to when I use cx_freeze. So text-unidecode cannot work.

Is there an elegant way to solve this with cx_freeze? Alternatively, add data files to


source to share

All Articles