Ubuntu 12.04安装nodejs折腾记

      以前在centos上安装,ubuntu安装,从来没有像这次这么折腾,可能是刚来工作单位的原因吧....

         

wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz

解压、编译

tar xzvf Python-2.7.3
cd Python-2.7.3
./configure
make && make install

首先下载node最新的源码包

wget http://nodejs.org/dist/v0.8.11/node-v0.8.11.tar.gz

解压,然后开始编译

tar -zxf node-v0.8.11.tar.gz
cd node-v0.8.11
./configure
总之出现了一个以前没有出现的错误,叫
ImportError: No module named bz2
终于让我发现了答案:

This is related to issue #2316

I followed the README for recent node versions stating that python 2.6 or 2.7 is needed, and then I spent quite a long time before succeeding to compile Python with bz2

Maybe it's specific to my environment and I don't install unix stuff everyday but I think the README desserves at least a mention in case of python/bz2 installation problem and at least links to these two bugs

In my case, it was solved following this :

http://stackoverflow.com/questions/812781/pythons-bz2-module-not-compiled-by-default http://www.kelvinwong.ca/2010/08/02/python-2-7-on-dreamhost/

But both methods are not totally correct (in my case at least), the correct sequence is more something like (sorry for the imprecision but I spent enough time on this, probably some people can correct easily if needed) :

wget http://bzip.org/1.0.6/bzip2-1.0.6.tar.gz tar xpzf bzip2-1.0.6.tar.gz cd bzip2-1.0.6 make -f Makefile_libbz2_so make make install PREFIX=/usr/local cp ./libbz2.so.1.0.6 /usr/local/lib

cd Python-2.7.3 ./configure --prefix=/usr/local make install


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值