From jonlederman at gmail.com Wed May 25 13:41:57 2016 From: jonlederman at gmail.com (Jon Lederman) Date: Wed, 25 May 2016 13:41:57 -0400 Subject: [C++-sig] Linking Boost-Python to Python Library in OS X and Anaconda Python 3.5 Message-ID: <3A607935-B5F1-4A24-B6FF-FAB08D6A8F57@gmail.com> Hi, I am having some issues using boost-python on OS X using Anaconda Python 3.5. I am able to build a simple c++ function using boost-python and call it from Python. However, when I create a simple class and call the constructor, I am met with: In [2]: hello_ext.World() --------------------------------------------------------------------------- TypeError Traceback (most recent call last) in () ----> 1 hello_ext.World() TypeError: __init__() should return None, not ?NoneType' From what I understand, this means that I have linked boost-python. against an incompatible version of Python. I thought I had build boost-python correctly (I have built directly using bjam and have tried binaries from Anaconda). However, when I try to see what Python libraries are linked against boost-python, I don?t see any reference to any Python libraries: boost_python_test Jon$ otool -L /Users/Jon/anaconda/envs/my-env/lib/libboost_python3.dylib /Users/Jon/anaconda/envs/my-env/lib/libboost_python3.dylib: @rpath/./libboost_python3.dylib (compatibility version 0.0.0, current version 0.0.0) /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 52.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0) Shouldn?t a call to otool show me which Python library was linked to boost-python? And, if none is reported what does that mean? Any help with the above issues would be greatly appreciated. Thanks. -Jon From pangshuyue at outlook.com Thu May 26 09:14:05 2016 From: pangshuyue at outlook.com (=?gb2312?B?5czK59S9?=) Date: Thu, 26 May 2016 13:14:05 +0000 Subject: [C++-sig] Linking Boost-Python to Python Library in OS X and Anaconda Python 3.5 In-Reply-To: <3A607935-B5F1-4A24-B6FF-FAB08D6A8F57@gmail.com> References: <3A607935-B5F1-4A24-B6FF-FAB08D6A8F57@gmail.com> Message-ID: Hello,I'm so sorry that I can't solve your problem.Actually,I'm new to python,and I am poor at c++.So,very sorry. AlstonWilliams > From: jonlederman at gmail.com > Date: Wed, 25 May 2016 13:41:57 -0400 > To: cplusplus-sig at python.org > Subject: [C++-sig] Linking Boost-Python to Python Library in OS X and Anaconda Python 3.5 > > Hi, > > I am having some issues using boost-python on OS X using Anaconda Python 3.5. I am able to build a simple c++ function using boost-python and call it from Python. However, when I create a simple class and call the constructor, I am met with: > > In [2]: hello_ext.World() > --------------------------------------------------------------------------- > TypeError Traceback (most recent call last) > in () > ----> 1 hello_ext.World() > > TypeError: __init__() should return None, not ?NoneType' > > From what I understand, this means that I have linked boost-python. against an incompatible version of Python. I thought I had build boost-python correctly (I have built directly using bjam and have tried binaries from Anaconda). However, when I try to see what Python libraries are linked against boost-python, I don?t see any reference to any Python libraries: > > boost_python_test Jon$ otool -L /Users/Jon/anaconda/envs/my-env/lib/libboost_python3.dylib > /Users/Jon/anaconda/envs/my-env/lib/libboost_python3.dylib: > @rpath/./libboost_python3.dylib (compatibility version 0.0.0, current version 0.0.0) > /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 52.0.0) > /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0) > > Shouldn?t a call to otool show me which Python library was linked to boost-python? And, if none is reported what does that mean? > > Any help with the above issues would be greatly appreciated. > > Thanks. > > -Jon > _______________________________________________ > Cplusplus-sig mailing list > Cplusplus-sig at python.org > https://mail.python.org/mailman/listinfo/cplusplus-sig -------------- next part -------------- An HTML attachment was scrubbed... URL: