You are not logged in.

#1 2012-05-04 13:46:35

Janax
Member
From: Iowa
Registered: 2007-05-21
Posts: 86

[SOLVED] PyDev problems - trying to load xmlrpclib

I'm currently stuck trying to figure out why I can no longer debug my python3 program.  Whenever I try to start the debug session, I get the following:

Traceback (most recent call last):
  File "/usr/share/eclipse/dropins/pydev/eclipse/plugins/org.python.pydev.debug_2.5.0.2012040618/pysrc/pydev_imports.py", line 3, in <module>
    import xmlrpclib
ImportError: No module named xmlrpclib

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/share/eclipse/dropins/pydev/eclipse/plugins/org.python.pydev.debug_2.5.0.2012040618/pysrc/pydev_imports.py", line 5, in <module>
    import xmlrpc.client as xmlrpclib
  File "/usr/lib/python3.2/xmlrpc/client.py", line 133, in <module>
    from xml.parsers import expat
  File "/usr/lib/python3.2/xml/parsers/expat.py", line 6, in <module>
    from pyexpat import *
ImportError: /usr/lib/python3.2/lib-dynload/pyexpat.cpython-32mu.so: undefined symbol: XML_SetHashSalt

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/share/eclipse/dropins/pydev/eclipse/plugins/org.python.pydev.debug_2.5.0.2012040618/pysrc/pydevd.py", line 3, in <module>
    import pydev_imports
  File "/usr/share/eclipse/dropins/pydev/eclipse/plugins/org.python.pydev.debug_2.5.0.2012040618/pysrc/pydev_imports.py", line 7, in <module>
    import _pydev_xmlrpclib as xmlrpclib
SystemError: Objects/tupleobject.c:126: bad argument to internal function

I've tried

  • clearing out Eclipse config in homedir and creating a new workspace

  • going back and installing PyDev 2.4.0 (2.5.0 is now installed, as seen in the error messages),

  • installing PyDev via Eclipse's internal plugin installer instead of using the AUR package,

  • linking '/usr/bin/python' to '/usr/bin/python2' instead of python3 (because xmlrpclib is the Python2 version of the xmlrpc.{server,client} in Python3), and even

  • installing a completely new Arch partition from scratch (enough to get pydev working, of course) without success.

Since I was covering all bases without going into PyDev source code, I also tried a LinuxMint 12 partition and that, of course, worked.  Searching Google hasn't led to any solutions that I can find, either (mixed in with all the other attempts above, of course).

Can someone out there please recommend something else to try or perhaps even know what the exact problem is?  I suppose the next step would be to look at the PyDev source code, but I'm hoping I won't need to invest that much time into it (slightly hypocritical tongue)...

Thanks for any help on this!

EDIT: forgot about simple steps to clear out Eclipse config files in homedir and creating a new workspace.

Last edited by Janax (2012-06-06 18:50:14)

Offline

#2 2012-06-01 08:55:23

jeancf
Member
Registered: 2011-03-02
Posts: 6

Re: [SOLVED] PyDev problems - trying to load xmlrpclib

Hi,

I am running into the same problem. Could you clarify what the solution that you found is? I can't find eclipse config files in my homedir.

Thanks,

/~jc

Offline

#3 2012-06-06 18:49:56

Janax
Member
From: Iowa
Registered: 2007-05-21
Posts: 86

Re: [SOLVED] PyDev problems - trying to load xmlrpclib

I finally(!) found the solution!

Short explanation: The issue for me was that I had LD_LIBRARY_PATH set to my Oracle installation.

Long explanation: Library resolution problem since I had LD_LIBRARY_PATH pointing to my Oracle installation (I'm using cx_Oracle in Python as well):

$ ldd /usr/lib/python3.2/lib-dynload/pyexpat.cpython-32mu.so 
        linux-vdso.so.1 =>  (0x00007fffabda3000)
***        libexpat.so.1 => /u01/oracle/11.2.0/lib/libexpat.so.1 (0x00007f85bbb74000) ***
        libpython3.2mu.so.1.0 => /usr/lib/libpython3.2mu.so.1.0 (0x00007f85bb74e000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x00007f85bb532000)
        libc.so.6 => /lib/libc.so.6 (0x00007f85bb191000)
        libdl.so.2 => /lib/libdl.so.2 (0x00007f85baf8c000)
        libutil.so.1 => /lib/libutil.so.1 (0x00007f85bad89000)
        libm.so.6 => /lib/libm.so.6 (0x00007f85baa94000)
        /lib/ld-linux-x86-64.so.2 (0x00007f85bbeb4000)

I added the *** to highlight the line causing the issue.  There are several ways to fix this problem, but I took the one that hopefully will impact the entire system the least (that is, I'm assuming that Arch 'libexpat' is newer than Oracle's version and have Oracle's libraries find/use the Arch version, so hopefully no system issues).  Another way to do it would place '/usr/lib' in front of Oracle's entry in LD_LIBRARY_PATH, but that may affect other Oracle libraries as well.  Here is what I did:

$ cd $ORACLE_HOME/lib
$ sudo mv libexpat.so.1 libexpat.so.1.NOFIND
$ ldd  /usr/lib/python3.2/lib-dynload/pyexpat.cpython-32mu.so
        linux-vdso.so.1 =>  (0x00007fff8b5ff000)
***        libexpat.so.1 => /usr/lib/libexpat.so.1 (0x00007fd00a45f000) ***
        libpython3.2mu.so.1.0 => /usr/lib/libpython3.2mu.so.1.0 (0x00007fd00a05b000)
        libpthread.so.0 => /lib/libpthread.so.0 (0x00007fd009e3e000)
        libc.so.6 => /lib/libc.so.6 (0x00007fd009a9d000)
        libdl.so.2 => /lib/libdl.so.2 (0x00007fd009899000)
        libutil.so.1 => /lib/libutil.so.1 (0x00007fd009695000)
        libm.so.6 => /lib/libm.so.6 (0x00007fd0093a0000)
        /lib/ld-linux-x86-64.so.2 (0x00007fd00a8b9000)

After this change, the pydev debugger launches and runs correctly!  Woohoo!

Last edited by Janax (2012-06-06 18:51:20)

Offline

#4 2012-10-29 10:58:50

masuch
Member
Registered: 2011-09-11
Posts: 2

Re: [SOLVED] PyDev problems - trying to load xmlrpclib

Thank you for posting this detailed solution for many similar problems.
I had the problem with "bzr pull --overwrite" using python (in Ubuntu 12.10):
ImportError: /usr/lib/python2.7/lib-dynload/pyexpat.so: undefined symbol: XML_SetHashSalt
Now it works.
You saved me a lot of lot of time. Thanks

Offline

Board footer

Powered by FluxBB