在Ubuntu 13.1上安装PyXML后,我无法导入AdWordsClient

时间:2013-11-22 20:33:33

标签: python python-2.7 google-adwords ubuntu-13.10 pyxml

所以我最初在向Ubuntu 13.1添加PyXML时遇到了问题。原来我需要对我的PyConfig.h文件进行更改,这很痛苦。

最终系统能够成功构建PyXML,但现在,当我尝试从adspygoogle导入AdWordsClient时(之前工作正常),我收到此错误:

    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

现在,当我卸载PyXML并重新启动空闲时,导入工作正常,非常感谢。

太困惑了!

1 个答案:

答案 0 :(得分:0)

adspygoogle似乎为不同的平台构建了.so。也许它是64位,你使用的是32位?你是怎么安装这个包的? PIP刚刚在我的10.8 Mac以及我的CentOS 6.2包装盒上正确安装了adspygoogle和PyXML-0.8.4