Pyhon源码编译安装

下载版本

python下载源码python2.7.11安装(记得要下载python 2.7版本的),下载地址:

http://www.python.org/download/

安装步骤为(python 2.7的安装对是否能成功安装skyeye有决定性作用):

编译

注意:没有这个两个编译选项,你会发现有无穷无尽的错误在等着你解决,不过我仍然相信你乐于去解决。

./configure –prefix=/usr/local/python2.7 –enable-shared –enable-unicode=ucs4
make && make install

然后你需要将python的lib库导出,下面是方法:

vim /etc/ld.so.conf 加上include /usr/local/python2.7/lib 保存退出
然后/sbin/ldconfig

说明:python的内部是使用unicode来处理的,但是unicode的使用需要考虑的是它的编码格式有两种,一是UCS-2,它一共有65536个码位,另一种是UCS-4,它有2147483648g个码位。在编译时通过–enable-unicode=ucs2或–enable-unicode=ucs4来指定的。那么我们自己默认安装的python用的什么编码怎么来确定呢?进入python安装后的目录,找到执行python,然后./python

import math,sys
print(“math.pi=={0.pi} sys.maxunicode=={1.maxunicode}”.format(math, sys))
quit()
如果sys.maxunicode==65535,那么就是UCS-2,如果输出是sys.maxunicode==1114111,就是UCS-4编码。

Python build finished, but the necessary bits to build these modules were not found:
_bsddb             _sqlite3           _tkinter        
bsddb185           dbm                dl              
gdbm               imageop            sunaudiodev     
To find the necessary bits, look in setup.py in detect_modules() for the module's name.

running build_scripts

参考

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值