我從系統的Python 2.6.4中刪除了numpy和scipy內容,以便爲它們安裝不同的版本,現在我打破了YUM。我得到的錯誤是:Fedora:使用YUM時沒有名爲RPM的模塊
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:
No module named rpm
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.6.4 (r264:75706, Jun 4 2010, 18:20:31)
[GCC 4.4.4 20100503 (Red Hat 4.4.4-2)]
If you cannot solve this problem yourself, please go to
the yum faq at:
http://yum.baseurl.org/wiki/Faq
而且當我從Python控制檯我得到以下錯誤內導入YUM:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 23, in <module>
import rpm ImportError:
No module named rpm
Python的狀態很好,我設法安裝numpy的,但是我想用YUM安裝scipy,我不能。當我運行時:
rpm --version
我得到:RPM版本4.8.1。
有沒有辦法解決這個問題?我會很感激任何意見或指示解決這個問題。
不知道如何解決你的問題,但是一旦你把它整理出來,你應該使用[virtualenv](http://virtualenv.readthedocs.org/en/latest/)並且保留你的基本Python安裝。 Virtualenv可以輕鬆創建獨立的Python環境及其管理,並且可以在不干擾主要安裝的情況下玩耍。 – mhawke 2014-10-10 13:52:12