【发布时间】:2016-04-20 19:02:16
【问题描述】:
更新:是的,这是一个愚蠢的举动。
由于我在导入一些模块/lib(时间、选择、子进程)时遇到了一些错误。想到了重装python,一个很大的错误。我不幸跑了apt-get remove python 和sudo rm -rf /usr/bin/python*
我已经下载了Python-2.7.6.tgz 并尝试安装。编译时出现错误,make install
Compiling /usr/local/lib/python2.7/xmllib.py ...
Compiling /usr/local/lib/python2.7/xmlrpclib.py ...
Compiling /usr/local/lib/python2.7/zipfile.py ...
make: *** [libinstall] Error 1
有什么方法可以恢复或安装 python?
apt-get -f install 报出如下错误
Removing libboost-python1.46-dev ...
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
dpkg: error processing libboost-python1.46-dev (--remove):
subprocess installed pre-removal script returned error exit status 1
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
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
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
libboost-python1.46-dev
E: Sub-process /usr/bin/dpkg returned an error code (1)
我已经导出了PYTHONHOME=/usr,但没有成功。这就是我现在运行python 时得到的
ImportError: No module named site
基本上我搞砸了python 操作系统:Ubuntu12.04 LTS - 服务器
更新:
这是我手动安装依赖项时遇到的错误
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Traceback (most recent call last):
File "/usr/sbin/update-python-modules", line 13, in <module>
from subprocess import call
File "/usr/lib/python2.7/subprocess.py", line 427, in <module>
import select
ImportError: /usr/lib/python2.7/site-packages/select.so: undefined symbol: _PyInt_AsInt
【问题讨论】:
-
尝试恢复您的系统。通过
apt-get安装 Python。你也可以试试sudo apt-get install ubuntu-desktop。 -
有什么方法可以在不恢复系统的情况下做到这一点
-
apt-get install --reinstall python怎么样?
-
第一句话不是任务,而是标题。
-
apt-get命令不起作用。E: Unmet dependencies. Try 'apt-get -f install' with no packages是我遇到的错误
标签: python bash python-2.7 shell ubuntu