Skip to main content
 首页 » 编程设计

python之如何修复 PyXML

2025年05月04日6jillzhang

我有一组使用 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