Hi Thomas You're a lifesaver. It helps to get expert advice! It didn't work initially, since I also had to add that extra path for the Visualisation section in setup.py, but I knew what to look for with otool.
Some the samples are working now, I didn't enable GEOM/SMESH so rebuilding those now as well. Thanks! Benjamin On Fri, Jan 7, 2011 at 11:08 PM, Thomas Paviot <tpav...@gmail.com> wrote: > 2011/1/7 Benjamin Nortier <bjnort...@gmail.com> > >> Hello > > > Hi Benjamin, > > I read you post on the pythonocc website, and I had time this afternoon to > check what's wrong and find a fix. > > >> >> I've been going back and forth with this, so any help would be >> appreciated. To date: >> - I'm using 64-bit fink and installed qt4-x11 and PyQt with that >> - I've tried PyQt from source using MacOSX python, but it's broken >> - I can either use MacOSX python, but get >> >> >>> from PyQt4.QtCore import * >> Traceback (most recent call last): >> File "<stdin>", line 1, in <module> >> ImportError: >> dlopen(/sw64/lib/qt4-x11/lib/python2.6/site-packages/PyQt4/QtCore.so, 2): >> Symbol not found: __PyByteArray_empty_string >> Referenced from: >> /sw64/lib/qt4-x11/lib/python2.6/site-packages/PyQt4/QtCore.so >> Expected in: flat namespace >> in /sw64/lib/qt4-x11/lib/python2.6/site-packages/PyQt4/QtCore.so >> > > You can't use the fink PyQt4 with Mac python. > > >> I've tried compiling PyQt4 from source with no luck. >> > > I did it once, but I had to hack the PyQt4 code. Rather use fink > (PyQt4/python). > > >> >> OR >> >> use the fink python, but then >> >> $python2.6 >> Python 2.6.6 (r266:84292, Jan 6 2011, 17:38:55) >> [GCC 4.2.1 (Apple Inc. build 5664)] on darwin >> Type "help", "copyright", "credits" or "license" for more information. >> >>> from OCC.Display.SimpleGui import * >> >>> from PyQt4.QtCore import * >> >>> set_backend('qt') >> >>> display, start_display, add_menu, add_function_to_menu = >> init_display() >> Fatal Python error: Interpreter not initialized (version mismatch?) >> Abort trap >> >> I suspect this error is because of the SWIG files and would like to >> rebuild pythonOCC with the fink python. Is this plausible, and how do I >> re-generate the SWIG files? I think I have all the dependencies. I have >> tried python2.6 generate_swig_files.py but it generates some cryptic errors. >> > > The pythonocc setup.py script actually links the library to the Mac python > libpython2.6.dylib (and I absolutely don't know why!). I reproduced the > issue: > > macbook-pro-de-thomas-paviot:OCC thomas$ /sw/bin/python2.6 > Python 2.6.6 (r266:84292, Jan 7 2011, 13:42:58) > [GCC 4.2.1 (Apple Inc. build 5664)] on darwin > Type "help", "copyright", "credits" or "license" for more information. > >>> import _Standard > Fatal Python error: Interpreter not initialized (version mismatch?) > Abort trap > > You can see that the libpython linked to _Standard.so is not the good one: > macbook-pro-de-thomas-paviot:OCC thomas$ otool -L _Standard.so > _Standard.so: > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version > 125.2.1) > /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version > 7.9.0) > /System/Library/Frameworks/Python.framework/Versions/2.6/Python > (compatibility version 2.6.0, current version 2.6.1) > /Library/OpenCASCADE/6.3.0//lib/libBinLPlugin.0.dylib (compatibility > version 1.0.0, current version 1.0.0) > > The third line should point to /sw/lib/python2.6/config/libpython2.6.dylib. > > So you have to tell the installer to link pythonocc to the fink > libpython2.6.dylib. I tried with LD_LIBRARY_PATH env var, but didn't get > anything working. So here is a fix. Assuming that you downloaded > pythonOCC-0.4.tar.gz: > - uncompress the tar.gz archive > - cd to pythonOCC-0.4/src > - edit the setup.py file and change the line 383: > > library_dirs=[environment.OCC_LIB,environment.SALOME_GEOM_LIB,environment.SALOME_SMESH_LIB], > to > > library_dirs=['/sw/lib/python2.6/config',environment.OCC_LIB,environment.SALOME_GEOM_LIB,environment.SALOME_SMESH_LIB], > - recompile pythonocc (/sw/bin/python2.6 setup.py build -f) > > After that, it works: > macbook-pro-de-thomas-paviot:OCC thomas$ /sw/bin/python2.6 > Python 2.6.6 (r266:84292, Jan 7 2011, 13:42:58) > [GCC 4.2.1 (Apple Inc. build 5664)] on darwin > Type "help", "copyright", "credits" or "license" for more information. > >>> import _Standard > >>> import _MMgt > >>> import _Quantity > >>> > > >> Any help would be appreciated >> >> Thanks >> Benjamin >> >> > Best Regards, > > Thomas > > >> >> -- >> Benjamin Nortier >> bjnort...@gmail.com >> http://www.twitter.com/bjnortier >> http://www.1011ltd.com >> +44 (0)778 946 1959 >> >> >> >> _______________________________________________ >> Pythonocc-users mailing list >> Pythonocc-users@gna.org >> https://mail.gna.org/listinfo/pythonocc-users >> >> > > _______________________________________________ > Pythonocc-users mailing list > Pythonocc-users@gna.org > https://mail.gna.org/listinfo/pythonocc-users > > -- Benjamin Nortier bjnort...@gmail.com http://www.twitter.com/bjnortier http://www.1011ltd.com +44 (0)778 946 1959
_______________________________________________ Pythonocc-users mailing list Pythonocc-users@gna.org https://mail.gna.org/listinfo/pythonocc-users