【发布时间】:2015-03-13 22:01:07
【问题描述】:
我在 Ubuntu 14.04 上手动安装了 2.7.8 python,但没有意识到 Ubuntu 已经附带了 2.7.6(我使用了这个方法,将 python 版本更改为 2.7.8:https://askubuntu.com/questions/101591/how-do-i-install-python-2-7-2-on-ubuntu)
当我列出我系统上的 python 版本时,输出如下。
pierre@pierre-VirtualBox:~/Téléchargements$ sudo find / -type f -executable -iname 'python*' -exec file -i '{}' \; | awk -F: '/x-executable; charset=binary/ {print $1}' | xargs readlink -f | sort -u | xargs -I % sh -c 'echo -n "%: "; % -V'
/home/pierre/Téléchargements/Python-2.7.8/python: Python 2.7.8
/usr/bin/python2.7: Python 2.7.6
/usr/bin/python3.4: Python 3.4.0
/usr/bin/python3.4m: Python 3.4.0
/usr/local/bin/python2.7: Python 2.7.8
然后我用 Synaptic 安装了 PyQt4,当我检查它是否正确安装时,似乎没有。
pierre@pierre-VirtualBox:~/Téléchargements$ python
Python 2.7.8 (default, Jan 14 2015, 18:34:11)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import PyQt4
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named PyQt4
我需要 PyQt4 用于另一个程序,但这个程序没有检测到 PyQt4,而 synaptic 告诉我 PyQt4 已安装。
我相信我的 python 版本搞砸了:
一方面我认为 python 2.7.8 成为默认的 python 并且被我要安装的其他程序识别(它的安装是“手动”)
另一方面,synaptic 的“默认”python 版本似乎是 2.7.5,并且仅为这个版本安装了 PyQt4
因此,我想删除 python 2.7.8。 拜托,有人能指点我怎么做吗?
非常感谢您的帮助。 最好的问候,
皮埃尔
【问题讨论】:
-
既然你是用askUbuntu的指南安装的,那你为什么不问问怎么卸载呢?
标签: python-2.7 ubuntu pyqt4 uninstallation