I am quite new to python and have question about pyinstaller

What I have:

   1. Python script that imports dynamic library written in C++ (using 
   boost python)
   2. 
   
   If I run this script using python everything works fine
   
   python main.py startup
   
   3. 
   
   If I create binary using pyinstaller, and then try to run it, I got the 
   following
   
   dhcp80-241:bin gburanov$ ./my_binary startupFatal Python error: 
PyThreadState_Get: no current threadAbort trap: 6
   
   4. 
   
   Backtrace of crash is following
   
   Thread 0 Crashed:: Dispatch queue: com.apple.main-thread0   
libsystem_kernel.dylib          0x00007fff8b997d46 __kill + 101   
libsystem_c.dylib               0x00007fff84074f83 abort + 1772   
org.python.python               0x0000000108fe6eaa Py_FatalError + 493   
org.python.python               0x0000000108fe5370 PyThreadState_Get + 284   
org.python.python               0x0000000108fe0f16 Py_InitModule4_64 + 585   
idver_wrapper.so                0x0000000108f3cfb4 
boost::python::detail::init_module(char const*, void (*)()) + 366   
idver_wrapper.so                0x0000000108f29eeb initidver_wrapper + 277   
Python                          0x0000000108babe0d _PyImport_LoadDynamicModule 
+ 1838   Python                          0x0000000108ba66a6 0x108b66000 + 
2638469   Python                          0x0000000108b7f5a9 PyEval_EvalFrameEx 
+ 924410  Python                          0x0000000108b7d147 PyEval_EvalCodeEx 
+ 193411  Python                          0x0000000108bb6d7a 0x108b66000 + 
331130
   
   
I have read that the problem can be that dynamic library is linked to one 
version of python and pyinstaller is linking to another version of python 
(mentioned here Homebrew + Python on mac os x 10.8: Fatal Python error: 
PyThreadState_Get: no current thread importing mapnik 
<http://stackoverflow.com/questions/15678153/homebrew-python-on-mac-os-x-10-8-fatal-python-error-pythreadstate-get-no-cu?rq=1>
 
) but I checked the following

     dhcp80-241:src gburanov$ otool -L ./idver_wrapper.so
     ./idver_wrapper.so:
      /System/Library/Frameworks/Python.framework/Versions/2.7/Python 
(compatibility version 2.7.0, current version 2.7.2)
      /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 
56.0.0)
      /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 
169.3.0)

and pyinstaller log

    151 INFO: wrote /Users/gburanov/repo/..../build/my_binary.spec
    177 WARNING: You are running 64-bit Python: created binaries will only work 
on Mac OS X 10.6+.
    If you need 10.4-10.5 compatibility, run Python as a 32-bit binary with 
this command:

     VERSIONER_PYTHON_PREFER_32_BIT=yes arch -i386 
/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python

Therefore, I make the conclusion that pyinstaller and dynamic library 
python versions are the same.

Then, what can be the source of problem?

ADDED Later: I looked closely at the crash report and notice that I still 
have two pythons in binary

Binary Images:
   0x108b0c000 -        0x108b28fff +sauth_binary (???) 
<9713FFC1-8C05-32D2-9F32-2D66A090EB52> /Users/USER/Downloads/sauth_binary
   0x108b66000 -        0x108c73fff +Python (60.4) 
<E7F3EED1-E55D-32AF-9649-77C814693F6A> /var/folders/*/Python
   0x108d89000 -        0x108d8cfff +_struct.so (60.4) 
<FF637943-8866-37F5-8B48-B97002F502A3> /var/folders/*/_struct.so
   0x108d92000 -        0x108d94fff +zlib.so (60.4) 
<9F2F691B-1510-335A-B9FE-6600523D90FB> /var/folders/*/zlib.so
   0x108eaa000 -        0x108eadfff +_collections.so (60.4) 
<02413565-C29E-3C7A-8E01-8C9C19642F15> /var/folders/*/_collections.so
   0x108eb3000 -        0x108eb6fff +operator.so (60.4) 
<FD5EC6F3-D0F9-358F-BF08-DC4B4F2109CB> /var/folders/*/operator.so
   0x108ebc000 -        0x108ec2fff +itertools.so (60.4) 
<36330819-32C7-3183-B213-2E1142050B3B> /var/folders/*/itertools.so
   0x108ecb000 -        0x108ecbfff +_bisect.so (60.4) 
<EE97CCA4-3D48-3CEC-B163-37E3AC0DCDA1> /var/folders/*/_bisect.so
   0x108ecf000 -        0x108ed0fff +_heapq.so (60.4) 
<7B91BA4D-5485-31BA-9FF9-789C6F3D0820> /var/folders/*/_heapq.so
   0x108f15000 -        0x108f18fff +strop.so (60.4) 
<282D8F1C-D709-339B-86E2-CE318F0E28E6> /var/folders/*/strop.so
   0x108f1e000 -        0x108f1ffff +_functools.so (60.4) 
<4DF8234E-F5DF-315B-A1CA-7C8C5C203901> /var/folders/*/_functools.so
   0x108f23000 -        0x108f24fff +_locale.so (60.4) 
<F8B95D0E-DAE2-359E-8B79-E3C8BE477D2D> /var/folders/*/_locale.so
   0x108f28000 -        0x108f60ff7 +idver_wrapper.so (0) 
<9EAC31C1-AE3B-33BA-B104-B80A7CD0FC14> /var/folders/*/idver_wrapper.so
   0x108f95000 -        0x1090a2fff  org.python.python (2.7.2 - 2.7.2) 
<E7F3EED1-E55D-32AF-9649-77C814693F6A> 
/System/Library/Frameworks/Python.framework/Versions/2.7/Python

But the second one is in temp directory /var/folders and binary equals to 
/System/Library/Frameworks/Python.framework/Versions/2.7/Python 

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pyinstaller.
For more options, visit https://groups.google.com/d/optout.

Reply via email to