我有一组使用PyXML的python脚本。脚本过去可以正常工作,但现在出现错误。

我怎样才能最好地修复它?

$ script.py
Traceback (most recent call last):
  File "/cygdrive/c/mypath/script.py", line 16, in <module>
    from xml import xpath
  File "/cygdrive/c/data/code/xml/PyXML-0.8.4/xml/xpath/__init__.py", line 105, in <module>
    import Context
  File "/cygdrive/c/data/code/xml/PyXML-0.8.4/xml/xpath/Context.py", line 15, in <module>
    import CoreFunctions
  File "/cygdrive/c/data/code/xml/PyXML-0.8.4/xml/xpath/CoreFunctions.py", line 20, in <module>
    from xml.xpath import Util, Conversions
  File "/cygdrive/c/data/code/xml/PyXML-0.8.4/xml/xpath/Conversions.py", line 22, in <module>
    from xml.utils import boolean
ImportError: cannot import name boolean


然后,我尝试重新安装PyXML。此操作失败。

$ easy_install PyXML
Searching for PyXML
Reading http://pypi.python.org/simple/PyXML/
Reading http://www.python.org/sigs/xml-sig/
Best match: PyXML 0.8.4
Downloading http://downloads.sourceforge.net/pyxml/PyXML-0.8.4.tar.gz?modtime=1101741917&big_mirror=0
Processing PyXML-0.8.4.tar.gz
Running PyXML-0.8.4/setup.py -q bdist_egg --dist-dir /tmp/easy_install-ZIX2LS/PyXML-0.8.4/egg-dist-tmp-5x8fiU
warning: no files found matching '*.html' under directory 'extensions/expat'
warning: no files found matching '*Makefile' under directory 'extensions/expat'
warning: no files found matching '*.dsp' under directory 'extensions/expat'
warning: no previously-included files matching '*/CVS/*' found anywhere in distribution
     69 [main] python 3116 C:\cygwin\bin\python.exe: *** fatal error - unable to remap C:\cygwin\bin\cygcrypto-0.9.8.dll to same address as parent: 0x600000 != 0x910000
Stack trace:
Frame     Function  Args
00285F18  6102749B  (00285F18, 00000000, 00000000, 00000000)
00286208  6102749B  (61177B80, 00008000, 00000000, 61179977)
00287238  61004AFB  (611A136C, 6124060C, 00600000, 00910000)
End of stack trace
      2 [main] python 6800 fork: child 3116 - died waiting for dll loading, errno 11
error: Setup script exited with error: Resource temporarily unavailable

最佳答案

我不知道这是否可以专门解决您的问题,但是我遇到了类似的问题,我用谷歌搜索并将其转至此处。
对于来自Google的人,问题出在pip安装上,其解决方法是:

您需要安装它,您应该在网上找到文件PyXML-0.8.4.tar.gz,然后运行:

pip install the PyXML tarball

07-27 15:47