嗨,我最近从 debian lenny 升级到了 squezee,升级过程中我发现一些 python 文件出现了问题。现在我也遇到了同样的问题,我需要解决它,这样我才能安装打印机驱动程序和 sane:
dpkg --configure -a
Setting up python-imaging (1.1.7-2) ...
Traceback (most recent call last):
File "/usr/local/lib/python2.5/runpy.py", line 95, in run_module
filename, loader, alter_sys)
File "/usr/local/lib/python2.5/runpy.py", line 52, in _run_module_code
mod_name, mod_fname, mod_loader)
File "/usr/local/lib/python2.5/runpy.py", line 32, in _run_code
exec code in run_globals
File "/usr/local/lib/python2.5/py_compile.py", line 164, in <module>
main()
File "/usr/local/lib/python2.5/py_compile.py", line 159, in main
compile(filename, doraise=True)
File "/usr/local/lib/python2.5/py_compile.py", line 115, in compile
f = open(file, 'U')
IOError: [Errno 2] No such file or directory: '-'
Traceback (most recent call last):
File "/usr/bin/pycompile", line 320, in <module>
main()
File "/usr/bin/pycompile", line 299, in main
options.force, options.optimize, e_patterns)
File "/usr/bin/pycompile", line 217, in compile
pipe.send(fn)
File "/usr/bin/pycompile", line 180, in py_compile
stdin.write(filename + '\n')
IOError: [Errno 32] Broken pipe
dpkg: error processing python-imaging (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
python-imaging
错误同样如下:
aptitude -f install
并且同样的错误:
# apt-get --reinstall install python-imaging
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 11 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up python-imaging (1.1.7-2) ...
Traceback (most recent call last):
File "/usr/local/lib/python2.5/runpy.py", line 95, in run_module
filename, loader, alter_sys)
File "/usr/local/lib/python2.5/runpy.py", line 52, in _run_module_code
mod_name, mod_fname, mod_loader)
File "/usr/local/lib/python2.5/runpy.py", line 32, in _run_code
exec code in run_globals
File "/usr/local/lib/python2.5/py_compile.py", line 164, in <module>
main()
File "/usr/local/lib/python2.5/py_compile.py", line 159, in main
compile(filename, doraise=True)
File "/usr/local/lib/python2.5/py_compile.py", line 115, in compile
f = open(file, 'U')
IOError: [Errno 2] No such file or directory: '-'
Traceback (most recent call last):
File "/usr/bin/pycompile", line 320, in <module>
main()
File "/usr/bin/pycompile", line 299, in main
options.force, options.optimize, e_patterns)
File "/usr/bin/pycompile", line 217, in compile
pipe.send(fn)
File "/usr/bin/pycompile", line 180, in py_compile
stdin.write(filename + '\n')
IOError: [Errno 32] Broken pipe
dpkg: error processing python-imaging (--configure):
subprocess installed post-installation script returned error exit status 1
configured to not write apport reports
Errors were encountered while processing:
python-imaging
答案1
你的问题之一是你在本地安装了一个或多个版本的 Python。我得到
$ dlocate runpy.py
python2.5-minimal: /usr/lib/python2.5/runpy.py
python2.6-minimal: /usr/lib/python2.6/runpy.py
但是,我在上面的脚本中看到了 /usr/local/lib/python2.5/runpy.py。这意味着您安装了 python 2.5 的本地副本,并且您的系统正在尝试使用它。您可能在 2.5 不是默认版本且可能在 Debian 中不可用时安装了它。但是,没有理由再安装 Python 2.5 的本地版本。
我建议您删除本地 python 安装并安装正确的 Debian 包。另外,您认为试图使用 2.5 的包是错误的,这是错误的。在 squeeze 中,所有 python 包都编译为支持 2.5 和 2.6。HTH。
答案2
正如您所见,python 版本存在一些问题,因为它尝试使用 python2.5。
我的更新替代方案只有 2.4 和 2.5。然后我删除了 python2.4 和 python2.5,最后将符号链接 /usr/bin/python 更改为指向 python2.6(尽管我认为它指向 python2.6)。最后一切都完美运行。