Error with standalone wxpython app created with py2app

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Error with standalone wxpython app created with py2app

Oksana Meledin
I am trying to create a standalone Mac GUI app.

I used wxPython (wxpython-phoenix 3.0.3) to create the GUI.

I am trying to use py2app (0.14) to create a standalone app that can be used on a different machine not requiring a python installation.

The wxPython works fine by itself on the machine where it was created (MacOS Sierra, virtual environment in miniconda python).

I am able to compile the app using py2app, but the app does not work. When I run it from the command line, I get the following error:

Traceback (most recent call last):
  File "/repos/ct/dist/CtAnnotator.app/Contents/Resources/__boot__.py", line 386, in <module>
    _run()
  File "/repos/ct/dist/CtAnnotator.app/Contents/Resources/__boot__.py", line 370, in _run
    exec(compile(source, path, 'exec'), globals(), globals())
  File "/repos/ct/dist/CtAnnotator.app/Contents/Resources/CtAnnotator.py", line 2, in <module>
    import wx
  File "/repos/ct/dist/CtAnnotator.app/Contents/Resources/lib/python2.7/wx/__init__.py", line 17, in <module>
    from wx.core import *
  File "/repos/ct/dist/CtAnnotator.app/Contents/Resources/lib/python2.7/wx/core.py", line 12, in <module>
    from ._core import *
ImportError: dlopen(/repos/ct/dist/CtAnnotator.app/Contents/Resources/lib/python2.7/wx/_core.so, 2): Symbol not found: _iconv
  Referenced from: /repos/ct/dist/CtAnnotator.app/Contents/MacOS/../Resources/lib/python2.7/wx/libwx_baseu-3.0.0.3.0.dylib
  Expected in: /repos/ct/dist/CtAnnotator.app/Contents/MacOS/../Frameworks/libiconv.2.dylib
 in /repos/ct/dist/CtAnnotator.app/Contents/MacOS/../Resources/lib/python2.7/wx/libwx_baseu-3.0.0.3.0.dylib
2017-07-14 00:46:55.453 CtAnnotator[38476:1598471] CtAnnotator Error

Here's my build python script:

#!/usr/bin/env python
"""
build_CtAnnotator.py - script for building CtAnnotator

Usage:
    % python build_CtAnnotator.py py2app
"""
from setuptools import setup
import sys
# from distutils.core import setup

sys.setrecursionlimit(20000)

APP = ['CtAnnotator.py']
PACKAGES = ['wx', 'os', 'dicom', 'operator', 'cv2', 'numpy', 'cPickle']
OPTIONS = {'argv_emulation': True,
           'plist': {'PyRuntimeLocations': ['/opt/localdepth/localdepth/localdepth/localdepth/localdepth/localdepth/miniconda2/envs/app-env/lib/libpython2.7.dylib']},
           'packages': ['wx'],
          }
DATA_FILES = []

setup(app=APP,
      data_files=DATA_FILES,
      options={'py2app': OPTIONS},
      setup_requires=['py2app'],
     )

The reason for the deep miniconda installation is to avoid the  "Mach-O header is too large to relocate in" error.

Can someone help me figure out how to solve this problem?

Thanks!

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error with standalone wxpython app created with py2app

Igor Korot
Hi, Oksana,

On Fri, Jul 14, 2017 at 4:13 AM, Oksana Meledin <[hidden email]> wrote:

> I am trying to create a standalone Mac GUI app.
>
> I used wxPython (wxpython-phoenix 3.0.3) to create the GUI.
>
> I am trying to use py2app (0.14) to create a standalone app that can be used
> on a different machine not requiring a python installation.
>
> The wxPython works fine by itself on the machine where it was created (MacOS
> Sierra, virtual environment in miniconda python).
>
> I am able to compile the app using py2app, but the app does not work. When I
> run it from the command line, I get the following error:

Are you trying to run the binary in the same environment or a different machine?

Thank you.

>
> Traceback (most recent call last):
>   File "/repos/ct/dist/CtAnnotator.app/Contents/Resources/__boot__.py", line
> 386, in <module>
>     _run()
>   File "/repos/ct/dist/CtAnnotator.app/Contents/Resources/__boot__.py", line
> 370, in _run
>     exec(compile(source, path, 'exec'), globals(), globals())
>   File "/repos/ct/dist/CtAnnotator.app/Contents/Resources/CtAnnotator.py",
> line 2, in <module>
>     import wx
>   File
> "/repos/ct/dist/CtAnnotator.app/Contents/Resources/lib/python2.7/wx/__init__.py",
> line 17, in <module>
>     from wx.core import *
>   File
> "/repos/ct/dist/CtAnnotator.app/Contents/Resources/lib/python2.7/wx/core.py",
> line 12, in <module>
>     from ._core import *
> ImportError:
> dlopen(/repos/ct/dist/CtAnnotator.app/Contents/Resources/lib/python2.7/wx/_core.so,
> 2): Symbol not found: _iconv
>   Referenced from:
> /repos/ct/dist/CtAnnotator.app/Contents/MacOS/../Resources/lib/python2.7/wx/libwx_baseu-3.0.0.3.0.dylib
>   Expected in:
> /repos/ct/dist/CtAnnotator.app/Contents/MacOS/../Frameworks/libiconv.2.dylib
>  in
> /repos/ct/dist/CtAnnotator.app/Contents/MacOS/../Resources/lib/python2.7/wx/libwx_baseu-3.0.0.3.0.dylib
> 2017-07-14 00:46:55.453 CtAnnotator[38476:1598471] CtAnnotator Error
>
> Here's my build python script:
>
> #!/usr/bin/env python
> """
> build_CtAnnotator.py - script for building CtAnnotator
>
> Usage:
>     % python build_CtAnnotator.py py2app
> """
> from setuptools import setup
> import sys
> # from distutils.core import setup
>
> sys.setrecursionlimit(20000)
>
> APP = ['CtAnnotator.py']
> PACKAGES = ['wx', 'os', 'dicom', 'operator', 'cv2', 'numpy', 'cPickle']
> OPTIONS = {'argv_emulation': True,
>            'plist': {'PyRuntimeLocations':
> ['/opt/localdepth/localdepth/localdepth/localdepth/localdepth/localdepth/miniconda2/envs/app-env/lib/libpython2.7.dylib']},
>            'packages': ['wx'],
>           }
> DATA_FILES = []
>
> setup(app=APP,
>       data_files=DATA_FILES,
>       options={'py2app': OPTIONS},
>       setup_requires=['py2app'],
>      )
>
> The reason for the deep miniconda installation is to avoid the  "Mach-O
> header is too large to relocate in" error.
> See: http://py2app.readthedocs.io/en/latest/faq.html
>
> Can someone help me figure out how to solve this problem?
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "wxPython-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [hidden email].
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error with standalone wxpython app created with py2app

Igor Korot
Also, check this thread: https://github.com/openai/universe/issues/139

On Fri, Jul 14, 2017 at 11:47 AM, Igor Korot <[hidden email]> wrote:

> Hi, Oksana,
>
> On Fri, Jul 14, 2017 at 4:13 AM, Oksana Meledin <[hidden email]> wrote:
>> I am trying to create a standalone Mac GUI app.
>>
>> I used wxPython (wxpython-phoenix 3.0.3) to create the GUI.
>>
>> I am trying to use py2app (0.14) to create a standalone app that can be used
>> on a different machine not requiring a python installation.
>>
>> The wxPython works fine by itself on the machine where it was created (MacOS
>> Sierra, virtual environment in miniconda python).
>>
>> I am able to compile the app using py2app, but the app does not work. When I
>> run it from the command line, I get the following error:
>
> Are you trying to run the binary in the same environment or a different machine?
>
> Thank you.
>
>>
>> Traceback (most recent call last):
>>   File "/repos/ct/dist/CtAnnotator.app/Contents/Resources/__boot__.py", line
>> 386, in <module>
>>     _run()
>>   File "/repos/ct/dist/CtAnnotator.app/Contents/Resources/__boot__.py", line
>> 370, in _run
>>     exec(compile(source, path, 'exec'), globals(), globals())
>>   File "/repos/ct/dist/CtAnnotator.app/Contents/Resources/CtAnnotator.py",
>> line 2, in <module>
>>     import wx
>>   File
>> "/repos/ct/dist/CtAnnotator.app/Contents/Resources/lib/python2.7/wx/__init__.py",
>> line 17, in <module>
>>     from wx.core import *
>>   File
>> "/repos/ct/dist/CtAnnotator.app/Contents/Resources/lib/python2.7/wx/core.py",
>> line 12, in <module>
>>     from ._core import *
>> ImportError:
>> dlopen(/repos/ct/dist/CtAnnotator.app/Contents/Resources/lib/python2.7/wx/_core.so,
>> 2): Symbol not found: _iconv
>>   Referenced from:
>> /repos/ct/dist/CtAnnotator.app/Contents/MacOS/../Resources/lib/python2.7/wx/libwx_baseu-3.0.0.3.0.dylib
>>   Expected in:
>> /repos/ct/dist/CtAnnotator.app/Contents/MacOS/../Frameworks/libiconv.2.dylib
>>  in
>> /repos/ct/dist/CtAnnotator.app/Contents/MacOS/../Resources/lib/python2.7/wx/libwx_baseu-3.0.0.3.0.dylib
>> 2017-07-14 00:46:55.453 CtAnnotator[38476:1598471] CtAnnotator Error
>>
>> Here's my build python script:
>>
>> #!/usr/bin/env python
>> """
>> build_CtAnnotator.py - script for building CtAnnotator
>>
>> Usage:
>>     % python build_CtAnnotator.py py2app
>> """
>> from setuptools import setup
>> import sys
>> # from distutils.core import setup
>>
>> sys.setrecursionlimit(20000)
>>
>> APP = ['CtAnnotator.py']
>> PACKAGES = ['wx', 'os', 'dicom', 'operator', 'cv2', 'numpy', 'cPickle']
>> OPTIONS = {'argv_emulation': True,
>>            'plist': {'PyRuntimeLocations':
>> ['/opt/localdepth/localdepth/localdepth/localdepth/localdepth/localdepth/miniconda2/envs/app-env/lib/libpython2.7.dylib']},
>>            'packages': ['wx'],
>>           }
>> DATA_FILES = []
>>
>> setup(app=APP,
>>       data_files=DATA_FILES,
>>       options={'py2app': OPTIONS},
>>       setup_requires=['py2app'],
>>      )
>>
>> The reason for the deep miniconda installation is to avoid the  "Mach-O
>> header is too large to relocate in" error.
>> See: http://py2app.readthedocs.io/en/latest/faq.html
>>
>> Can someone help me figure out how to solve this problem?
>>
>> Thanks!
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "wxPython-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [hidden email].
>> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error with standalone wxpython app created with py2app

Oksana Meledin
Hi Igor,

Thanks for taking a look at my issue.

I'm trying to run it on the same machine for now. The eventual goal is to run it on a different mac without a python development environment.

I did take a look at  https://github.com/openai/universe/issues/139. The issue is similar to mine but not the same. I am not trying to "import universe". Rather I am doing "import wx".

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error with standalone wxpython app created with py2app

David Hughes
In reply to this post by Oksana Meledin


On Friday, July 14, 2017 at 4:21:05 PM UTC+1, Oksana Meledin wrote:
I am trying to create a standalone Mac GUI app.

I used wxPython (wxpython-phoenix 3.0.3) to create the GUI.

I am trying to use py2app (0.14) to create a standalone app that can be used on a different machine not requiring a python installation.

The wxPython works fine by itself on the machine where it was created (MacOS Sierra, virtual environment in miniconda python).

I am able to compile the app using py2app, but the app does not work. When I run it from the command line, I get the following error:


As your app works OK with wx Python itself, you may get more help with the py2app part of it from the pythonmac-SIG list which often has discussions about py2app and its development.

Pythonmac-SIG maillist  -  [hidden email]
https://mail.python.org/mailman/listinfo/pythonmac-sig

--
Regards
David Hughes
Forestfield Software
 

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Loading...