我的操作系统是 VirtualBox 中的 ubuntu 15.10,我发现我无法升级我的操作系统,也无法打开软件中心。我试图用谷歌搜索这个问题,但是当我找到一些可以尝试的方法时。我也会发现更多新问题。并不能解决这些问题。
我尝试详细描述我所做的事情以及计算机的状况(错误消息)。谢谢!
$ 软件中心
Traceback (most recent call last):
File "/usr/bin/software-center", line 25, in <module>
from gi.repository import Gtk, GObject
ImportError: No module named gi.repository
我谷歌“没有名为 gi.repository 的模块”,发现我需要安装 PyGObject ,但是..
$ sudo pip 安装 PyGObject
Collecting PyGObject
Downloading pygobject-2.28.3.tar.bz2 (889kB)
100% |████████████████████████████████| 890kB 917kB/s
Complete output from command python setup.py egg_info:
********************************************************************
* Building PyGObject using distutils is only supported on windows. *
* To build PyGObject in a supported way, read the INSTALL file. *
********************************************************************
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-gaC6QU/PyGObject/
$ which python (我可以/我应该修改它/usr/bin/python
吗?)
/home/thisray/.pyenv/shims/python
$ pacman -Qikk python-gobject python
XIO: fatal IO error 22 (Invalid argument) on X server ":0"
after 4155 requests (4155 known processed) with 0 events remaining.
$ python -c“导入gi;打印(gi.__spec__)”
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named gi
$ python -c“导入gi;打印(gi.__dict__)”
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named gi
关于的问题
yum
$ sudo apt-get install yum
yum is the newest version ( in Taiwanese )
$ yum --版本
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:
No module named yum
Please install a package which provides this module, or
verify that the module is installed correctly.
It's possible that the above module doesn't match the
current version of Python, which is:
2.7.11 (default, Apr 25 2016, 16:08:52)
[GCC 5.2.1 20151010]
If you cannot solve this problem yourself, please go to
the yum faq at:
http://yum.baseurl.org/wiki/Faq
$哪里是蟒蛇
python: /usr/bin/python2.7-config /usr/bin/python3.4m
/usr/bin/python2.7-dbg /usr/bin/python3.4
/usr/bin/python2.7 /usr/bin/python3.5m
/usr/bin/python2.7-dbg-config /usr/bin/python
/usr/bin/python3.5 /usr/lib/python3.4
/usr/lib/python2.7 /usr/lib/python3.5
/etc/python3.4 /etc/python2.7 /etc/python /etc/python3.5
/usr/local/bin/python2.7-config /usr/local/bin/python2.7
/usr/local/lib/python3.4 /usr/local/lib/python2.7
/usr/local/lib/python3.5 /usr/include/python3.4m
/usr/include/python2.7 /usr/include/python3.5m
/usr/include/python2.7_d /usr/share/python
/home/thisray/.pyenv/shims/python3.5m-config
/home/thisray/.pyenv/shims/python2.7-config
/home/thisray/.pyenv/shims/python2.7
/home/thisray/.pyenv/shims/python3.5-config
/home/thisray/.pyenv/shims/python3.5m
/home/thisray/.pyenv/shims/python
/home/thisray/.pyenv/shims/python3.5
/home/thisray/bin/python2.7
/home/thisray/bin/python /usr/share/man/man1/python.1.gz
而且我尝试$ sudo vi /usr/bin/yum
并修改了#!/usr/bin/python
每个路径$ whereis python
,并使用不同版本的Python来做 >> import yum
,但yum
仍然不起作用
我已经安装了
pyenv
,并尝试了三个版本来测试yum
$ pyenv 版本
* system (set by /home/thisray/.pyenv/version)
2.7.11
3.5.1
(我通常用$ pyenv global 2.7.11
)
$点子--版本
pip 8.1.1 from /home/thisray/lib/python2.7/site-packages (python 2.7)
$点列表
pip (8.1.1)
setuptools (20.10.1)
wheel (0.29.0)
$ /usr/bin/python2.7-dbg
Python 2.7.10 (default, Oct 14 2015, 16:09:02)
[GCC 5.2.1 20151010] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import yum
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/yum/__init__.py", line 23, in <module>
import rpm
File "/usr/lib/python2.7/dist-packages/rpm/__init__.py", line 9, in <module>
from rpm._rpm import *
ImportError: /usr/lib/python2.7/dist-packages/rpm/_rpm.x86_64-linux-gnu.so: undefined symbol: Py_InitModule4_64
[52069 refs]
我认为所有问题的根源在于我安装了许多不同版本的 Python,而我没有使用好方法来安装/升级它们....
这是我第一次在这里用英语提问。我希望你能明白我的意思和我的问题是什么。非常感谢,对不起我的英语,我整天都在努力解决它……如果问题能解决,我将不胜感激!
如果有什么需要测试或解释的,请告诉我,谢谢!