undefined symbol: PyObject_GenericGetAttr when trying to embed Python

Andreas Jung lists at andreas-jung.com
Fri Jun 4 05:01:16 EDT 2004


I am trying to embed Python within a C++ application (Linux, Python2.3.4).
I am using the example from the example from the "Embeding and Extending" 
docs.
This works fine importing a simple module without any imports. However when 
I add
an "import urllib" inside the Python script to be imported through my C++ 
application
then the import fails:

Traceback (most recent call last):
  File "/home/ajung/sandboxes/HR2/hr2_zope_wrapper/hr2_wrapper.py", line 
16, in hr2_wrapper
    import urllib
  File "/opt/python-2.3.4/lib/python2.3/urllib.py", line 26, in ?
    import socket
  File "/opt/python-2.3.4/lib/python2.3/socket.py", line 44, in ?
    import _socket
ImportError: /opt/python-2.3.4/lib/python2.3/lib-dynload/_socket.so: 
undefined symbol: PyObject_GenericGetAttr

Any ideas?

Andreas





More information about the Python-list mailing list