Linux Mint 13 问题 - 没有名为 site 的模块

Linux Mint 13 问题 - 没有名为 site 的模块

我的 Linux Mint 13 64 位系统出现了问题。虽然我可以运行像 ls 和 vi 这样的基本命令,但如果我尝试更复杂的命令(我已经尝试过python2.7mysql-workbenchadduser),我得到:-

Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
ImportError: No module named site

我转到另一个系统(Mint 13 32位)并运行:

# echo $PYTHONHOME,

并得到一个空行所以不知道是什么

<prefix>[:<exec_prefix>]

是?

不确定下一步该去哪里?

经过进一步谷歌搜索后,我尝试了“sudo dpkg –configure -a”和“sudo apt-get install -f”,结果如下:-

HP-255-G1 # sudo dpkg --configure -a
dpkg: dependency problems prevent configuration of python-appindicator:
python-appindicator depends on libappindicator1 (= 0.4.92-0ubuntu1);
however:
Version of libappindicator1 on system is 0.4.92-0ubuntu1.1.
dpkg: error processing python-appindicator (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python-uno:
 python-uno depends on libreoffice-core (= 1:3.5.2-2ubuntu1); however:
Version of libreoffice-core on system is 1:3.5.7-0ubuntu7.
dpkg: error processing python-uno (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
python-appindicator
 python-uno

HP-255-G1 # sudo apt-get install -f
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
python-appindicator python-uno
The following packages will be upgraded:
python-appindicator python-uno
2 upgraded, 0 newly installed, 0 to remove and 690 not upgraded.
2 not fully installed or removed.
E: Could not get lock /var/cache/apt/archives/lock - open (11: Resource temporarily unavailable)
E: Unable to lock directory /var/cache/apt/archives/

因此,看起来“python-uno”和“python-appindicator”是某些问题的核心,但现在在哪里呢?

这是请求的输出:-

HP-255-G1# apt-cache policy python-uno python-appindicator
python-uno:
Installed: 1:3.5.2-2ubuntu1
Candidate: 1:3.5.7-0ubuntu7
Version table:
1:3.5.7-0ubuntu7 0
500 http://archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
500 http://security.ubuntu.com/ubuntu/ precise-security/main amd64 Packages
*** 1:3.5.2-2ubuntu1 0
500 http://archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
100 /var/lib/dpkg/status
python-appindicator:
Installed: 0.4.92-0ubuntu1
Candidate: 0.4.92-0ubuntu1.1
Version table:
0.4.92-0ubuntu1.1 0
500 http://archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
*** 0.4.92-0ubuntu1 0
500 http://archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
100 /var/lib/dpkg/status

我设法从命令行运行 Synaptic 包管理器,并尝试更新 python-uno 和 python-appindicator。这失败了,但希望输出(如下)是另一个线索:-

E: /var/cache/apt/archives/python-appindicator_0.4.92-0ubuntu1.1_amd64.deb:
subprocess new pre-removal script returned error exit status 1
E: /var/cache/apt/archives/python-uno_1%3a3.5.7-0ubuntu7_amd64.deb:
subprocess new pre-removal script returned error exit status 1

答案1

在聊天中与发帖者讨论后,开始http://chat.stackexchange.com/transcript/message/20047753#20047753,原来发帖人的机器不见了/usr/lib/python2.7,看http://chat.stackexchange.com/transcript/message/20052960#20052960。这解释了海报的大部分问题。特别是,错误:

Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
ImportError: No module named site

源于这些缺失的库。

接下来要做的就是恢复/usr/lib/python2.7.一种方法是下载与python2.7python2.7-minimal和对应的 deb 文件libpython2.7,然后使用dpkg -i. IE

apt-get download python2.7 python2.7-minimal libpython2.7
dpkg -i python*.deb

一旦完成,希望软件包系统将不再出问题。然后安装debsums(如果尚未安装),并使用 恢复剩余的丢失文件debsums -as

相关内容