configure your own python 2.5.2 on bluehost

作者:半瓶墨水   链接:

[I suppose the guy who need this will be able to read this article]

I have a shared host on, and want to have a lot of python libraries and applications to work on it.

Since it’s a shared host, I can’t install python libs, while I love ez_setup so much, I can’t live on python world without it.

Knowing from python-cn group, that I could build and use my own python on it. I should have got this solution earlier, this might be simple and naive for linux users.

OK, now let’s do it:


1. you must have shell access, please contact the bluehost support for a shell access

2. my dev box is windows xp, so I use putty, to connect my host

3. then use wget to download latest python, unzip it

tar xvzf Python-2.5.2.tgz

4. this step is critical, you need to replace “twomaom1” to your own user name below:

cd Python-2.5.2
./configure --prefix=/home/twomaom1/mypython --enable-unicode=ucs4
make install

5. now, let’s use the new python instead of the old one, you need to
a). cd ~
b). use any editor(I use vim), to edit your “.bashrc” file, add the following line at the end of the file

export PATH=/home/twomaom1/mypython/bin/:$PATH
export PYTHONPATH="/home/twomaom1/mypython/lib/python2.5:$PYTHONPATH"

6. now type “bash” and enter to refresh the shell, type “python -V” to view the python version.

You should already been successful.

from now on, easy_install or “python”, it’s your choice :)

Oh…don’t forget, in your python script, use the correct python path in the head, like mine:


Enjoy it ~!

Main Reference: Custom Python installation for Django on Dreamhost

4 条评论 发表在“configure your own python 2.5.2 on bluehost”上

  1. Li Xin说道:

    我就是follow这个来弄俺们的django framework的.

  2. 半瓶墨水说道:

    @Li Xin

  3. T.F.说道:


  4. […] 2. 更新python:bluehost上的python当前默认是2.4的,为了与时俱进,要升级一下,python的安装只要搞到shell权限就容易了,剩下的就是要规划好目录,并且配置shell的.bashrc环境变量,将新安装的python的bin目录加入到shell环境变量中,具体的可以参考这里。 […]