开发者

cleaning up python on ubuntu

My use case is probably not unusual. I want to use Ubuntu and the Google App Engine. The latest 开发者_StackOverflow社区Ubuntu has a version of Python which is not GAE compatible so it was necessary to go back to Python 2.5.5.

After doing so, "whereis python" reveals this mess:

python: /usr/bin/python /usr/bin/python2.6 /etc/python /etc/python2.6 
/usr/lib/python2.5 /usr/lib/python /usr/lib/python2.7 
/usr/lib/python2.6 /usr/lib64/python2.5 /usr/lib64/python 
/usr/lib64/python2.7 /usr/lib64/python2.6 /usr/local/bin/python2.5 
/usr/local/bin/python2.5-config /usr/local/bin/python 
/usr/local/lib/python2.5 /usr/local/lib/python2.6 
/usr/include/python2.6 /usr/share/python /usr/share/man/man1/python.1.gz

Should this be cleaned up or would cleaning it up be a risky waste of time? How would it be cleaned up? Was this avoidable? I realize a certain amount of this was by (linux) design but could some of that designed-in clutter have been minimized given that I know I always intend to have a one-user linux system?


Python is a very important utility used by apt and other packages on your system. I would try to undo whatever installation you did. When you reinstall python 2.5, install using the "altinstall" mechanism to keep python2.5 pointing to the old version:

E.g.:

# apt-get build-dep python
# wget my-python-2.5.tar.bz2
# tar -xvjf ...tar.bz2
# cd Python*
# ./configure --prefix=/usr
# make
# make altinstall

From then on, python and python2.x is still pointing to the standard python that came with the system, while python2.5 is pointing to python2.5, and you can use that in any of your applications (and select it as default in virtualenv.)


Depends how daring you are. You could have tools installed which depend on a specific version of python otherwise they will fail. It shouldn't cause any issues; however the version you get will be first on the PATH. If you want 2.5.5 make sure it is first when you are running your script targeting that version (of if you don't care your fine as-is).


Python2.6 is the default for the system, so long as /usr/bin/python is pointing to /usr/bin/python2.6 the system will be fine.

So you need to have 2.5 installed for GAE development
and 2.6 installed for the system

What's the problem? I have 2.4, 2.5, 2.6, 2.7 and 3.1 all on my ubuntu machine

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜