ajbmachon / guidata

Automatically exported from code.google.com/p/guidata
Other
0 stars 0 forks source link

CX_Freeze and guidata/guiqwt works on windows not on Linux #26

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a simple script (e.g. example given at the top of page 
http://code.google.com/p/guidata/)
2. Freeze using cx_Freeze

I used the following setup file
    import sys
    import os

"""Create a stand-alone executable"""

try:
    import guidata
    from guidata.disthelpers import Distribution
    except ImportError:
        raise ImportError, "This script requires guidata 1.4+"

    def create_executable():
        """Build executable using ``guidata.disthelpers``"""
        dist = Distribution()
        dist.setup(name='Foo', version='0.1',
               description='bar',
               script="test.py", target_name='test.exe')
        dist.add_modules('guidata', 'guiqwt')
        # Building executable
        dist.build('cx_Freeze')

    if __name__ == '__main__':
        create_executable()

What is the expected output? What do you see instead?

The executable gets built, but when attempted to run. It gives the error

    OSError: [Errno 20] Not a directory: '/home/user/tmp/dist/library.zip/guidata/images'

What version of the product are you using? On what operating system?
guidata 1.5.1 Linux

In windows this works fine!

Please provide any additional information below.

I traced the problem to the lines

    parentdir = osp.join(datapath, osp.pardir)
    if osp.isfile(parentdir)

in configtools.py file. 

See the following link where I posted a temporary hack to avoid the issue for 
the moment. 
http://stackoverflow.com/questions/14111366/cx-freeze-and-guiqwt-works-on-window
s-not-on-linux/14129726#14129726

Original issue reported on code.google.com by assela@pathirana.net on 2 Jan 2013 at 10:00