简体   繁体   中英

After installing PyXML on Ubuntu 13.1 I can't import AdWordsClient

So I initially was having issues adding PyXML to Ubuntu 13.1. It turned out I needed to make a change to my PyConfig.h file, which was a pain.

Eventually the system was able to successfully build PyXML but now, when I try to import AdWordsClient from adspygoogle (which was working fine before), I get this error:

    Warning (from warnings module):
  File "/usr/local/lib/python2.7/dist-packages/adspygoogle/__init__.py", line 26
    warnings.warn('Can\'t import AdWordsClient: %s' % e)
UserWarning: Can't import AdWordsClient: /usr/local/lib/python2.7/dist-packages/_xmlplus/parsers/pyexpat.so: undefined symbol: PyUnicodeUCS2_DecodeUTF8

Warning (from warnings module):
  File "/usr/local/lib/python2.7/dist-packages/adspygoogle/__init__.py", line 31
    warnings.warn('Can\'t import DfaClient: %s' % e)
UserWarning: Can't import DfaClient: /usr/local/lib/python2.7/dist-packages/_xmlplus/parsers/pyexpat.so: undefined symbol: PyUnicodeUCS2_DecodeUTF8

Warning (from warnings module):
  File "/usr/local/lib/python2.7/dist-packages/adspygoogle/__init__.py", line 36
    warnings.warn('Can\'t import DfpClient: %s' % e)
UserWarning: Can't import DfpClient: /usr/local/lib/python2.7/dist-packages/_xmlplus/parsers/pyexpat.so: undefined symbol: PyUnicodeUCS2_DecodeUTF8

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    from adspygoogle import AdWordsClient
ImportError: cannot import name AdWordsClient

Now, when I uninstall PyXML and reboot idle, the import works just fine, thank you very much.

So confused!

adspygoogle appears to have built a .so for a different platform than you are on. Perhaps it's 64-bit, and you're using 32-bit? How did you install this package? PIP just installed adspygoogle, along with PyXML-0.8.4 for me correctly on my 10.8 Mac, as well as my CentOS 6.2 box.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM