Embedded Python can't "import socket" -- "undefined symbol"

Steven Work steve at renlabs.com
Tue Jul 13 15:31:44 EDT 1999


I am embedding Python in a C program (on Linux 2.2.x, Debian 2.1), and
trying to run a script via PyRun_SimpleFile().  "print 'hello, world'"
works, but "import socket" dies.  Can anyone help me find out why?

$ ./testfile
Traceback (innermost last):
  File "jukebox_xml.py", line 1, in ?
    import socket
ImportError: /usr/lib/python1.5/lib-dynload/socketmodule.so: 
	undefined symbol: _Py_NoneStruct
$ nm testfile | grep NoneStruct
0808ecfc D _Py_NoneStruct

And of course "import socket" works fine in /usr/bin/python.  
-- 
Steven Work
Renaissance Labs
steve at renlabs.com
360 647-1833




More information about the Python-list mailing list