Ubuntu的11.10 +击+ Python的错误+ Python安装无效 [英] Ubuntu 11.10 + Bash + Python error + Invalid python installation

查看:361
本文介绍了Ubuntu的11.10 +击+ Python的错误+ Python安装无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

    File "/usr/lib/python2.7/site.py", line 562, in <module>
main()
    File "/usr/lib/python2.7/site.py", line 544, in main
known_paths = addusersitepackages(known_paths)
    File "/usr/lib/python2.7/site.py", line 271, in addusersitepackages
user_site = getusersitepackages()
    File "/usr/lib/python2.7/site.py", line 246, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
    File "/usr/lib/python2.7/site.py", line 236, in getuserbase
USER_BASE = get_config_var('userbase')
    File "/usr/lib/python2.7/sysconfig.py", line 543, in get_config_var
return get_config_vars().get(name)
    File "/usr/lib/python2.7/sysconfig.py", line 442, in get_config_vars
_init_posix(_CONFIG_VARS)
    File "/usr/lib/python2.7/sysconfig.py", line 321, in _init_posix
raise IOError(msg)
IOError: invalid Python installation: unable to open /usr/include/python2.7/pyconfig.h (No such file or directory)

我知道这是很similair这个<一个href=\"http://stackoverflow.com/questions/5345934/problem-running-python-from-crontab-invalid-python-installation\">question但我还是没能解决这个问题。

I know this is very similair to this question but i'm still not able to solve it

这其实没有什么关系命令未找到错误,因为即使当我这样做remove命令未找到它仍会出现程序。

This doesn't really have anything to do with command-not-found error because even when i do remove command-not-found program it still appears.

另外在执行命令提供了以下输出。

Also executing the command gives the following output.

$ which python
/usr/bin/python
$ python
<gives the same error pasted above>

如何解决这个问题呢?我在Ubuntu程序没有在工作。

How do i solve it? None of my programs in ubuntu are working.

推荐答案

很多的讨论后,并从PPL帮助在IRC上!

After a lot of discussion and help from ppl on irc!

由于意见对这些问题的一个建议,这被很多人认为脂肪酶主要是指令

As one of the comments to the questions have suggested, the main instruction that was suggested by many ppl was

apt-get install --reinstall packagename

但它并没有真的没什么帮助。

but it did not really seem to help.

所以,我只是下载python2.7-minimal_2.7.2-5ubuntu1_amd64.deb从Ubuntu的软件包网站和

So i simply downloaded python2.7-minimal_2.7.2-5ubuntu1_amd64.deb from the ubuntu package sites and

$ sudo dpkg -i python2.7-minimal_2.7.2-5ubuntu1_amd64.deb

瞧它的工作!一旦你完成了,一定要更新!

voila it worked! once you finish that, make sure you update!

这篇关于Ubuntu的11.10 +击+ Python的错误+ Python安装无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆