每当我尝试sudo update-manager时,它都会返回:
Fatal Python error: Py_Initialize: Unable to get the locale encoding
Traceback (most recent call last):
File "/usr/lib/python3.4/encodings/__init__.py", line 31, in <module>
ImportError: No module named 'codecs'我尝试了以下命令:
sudo apt-get update # no errors
sudo apt-get clean # no errors
sudo apt-get install -fy # same error
sudo apt-get install --reinstall python3 # same error
sudo apt-get install --reinstall dpkg apt update-manager python # same error
sudo apt-get autoremove # same error
sudo apt-get upgrade # same error
sudo apt-get install --reinstall python3.4 #E: Internal Error, No file name for python3.4:amd64
sudo apt-get install python3.4 # same error (Dependency problems )
python --version #Python 2.7.6
sudo apt-get -f install # same error (Dependency problems )我没有修改__ init __.py文件。
以下是一个完整的错误:
$ sudo apt-get -f install
[sudo] password for user:
Building dependency tree
Reading state information...
After this operation, 0 B of additional disk space will be used.
Setting up python3.4 (3.4.0-2ubuntu1) ...
Fatal Python error: Py_Initialize: Unable to get the locale encoding
Traceback (most recent call last):
File "/usr/lib/python3.4/encodings/__init__.py", line 31, in <module>
ImportError: No module named 'codecs'
Aborted (core dumped)
dpkg: error processing package python3.4 (--configure):
subprocess installed post-installation script returned error exit status 134
dpkg: dependency problems prevent configuration of python3:
python3 depends on python3.4 (>= 3.4.0-0~); however:
Package python3.4 is not configured yet.
dpkg: error processing package python3 (--configure):
dependency problems - leaving unconfigured
Setting up screen-resolution-extra (0.17.1) ...
No apport report written because the error message indicates its a followup error from a previous failure.
Fatal Python error: Py_Initialize: Unable to get the locale encoding
Traceback (most recent call last):
File "/usr/lib/python3.4/encodings/__init__.py", line 31, in <module>
ImportError: No module named 'codecs'
Aborted (core dumped)
dpkg: error processing package screen-resolution-extra (--configure):
subprocess installed post-installation script returned error exit status 134
dpkg: dependency problems prevent configuration of update-manager:
update-manager depends on python3; however:
Package python3 is not configured yet.
update-manager depends on python3:any (>= 3.3.2-2~); however:
Package python3 is not configured yet.
dpkg: error processing package update-manager (--configure):
dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
Errors were encountered while processing:
python3.4
python3
screen-resolution-extra
update-manager
E: Sub-process /usr/bin/dpkg returned an error code (1)我用的是Ubuntu 14.04 LTS。
发布于 2015-05-30 08:36:50
如果您的文件系统已经损坏,就会发生这种情况。检查日志中是否有提示,并查看/lost+found内部。解决方案是重新安装包含缺少模块的包。
查找提供此文件的Ubuntu包:
dpkg -S /usr/lib/python3.4/codecs.py重新安装软件包:
sudo apt-get install --reinstall libpython3.4-minimal另外,重新安装提供lost+found中任何其他文件的包
https://askubuntu.com/questions/554202
复制相似问题