[I suppose the guy who need this will be able to read this article]
I have a shared host on Bluehost.com, 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 2maomao.com
3. then use wget to download latest python, unzip it
wget http://www.python.org/ftp/python/2.5.2/Python-2.5.2.tgz
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
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
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 setup.py”, it’s your choice
Oh…don’t forget, in your python script, use the correct python path in the head, like mine:
#!/home/twomaom1/bin/python
Enjoy it ~!
0. 安装自己的Python,参见:configure your own python 2.5.2 on bluehost
1. 安装完以后重启shell(直接敲bash回车或者重连putty)
2. 下载并安装ez_setup
3. 我用mysql,所以安装mysql-python: easy_install mysql-python
4. 安装flup和django:
easy_install flup
下载django包,解压(我放到了/home/twomaom1/django/src目录),按照指令安装
5、设置子域名,我设置的是code.fayaa.com,网络不熟啊,至今不是很懂,似乎一些apache设置以及django默认配置的问题,搞个子域名比较好办
6、在该子域名的目录下(我的是:/home/twomaom1/public_html/fayaa/code/),新建.htaccess,内容如下: