Ubuntu下编译Python2.7

Ubuntu下编译Python2.7

步骤

Attention

  • 安装路径,参考 ./configure 说明,设置 --prefix 用于以后 make install 路径,以免覆盖系统 python

  • make 时出现如下类似提示,不必慌张。如 readline 依赖,先 sudo apt-get install libreadline-dev, 然后重新 make clean ./configure make 其它库也类似。重要的是参考对应的官方说明加GOOGLE,比如先前版本的编译是在 ./configure 加参数 --with-readline 来增加此支持,但新版已去除此配置。可以参考 Building Python and more on missing modules

    Python build finished, but the necessary bits to build these modules were not found:
    _bsddb             _curses            _curses_panel   
    _tkinter           bsddb185           bz2             
    dbm                gdbm               readline        
    sunaudiodev        _sqlite3                                    
    To find the necessary bits, look in setup.py in detect_modules() for the module's name.
    
  • 最后 make install 到之前 --prefix 配置的相应目录下

  • 补充 Linux Python 路径下 dist-packages site-packages 的区别。总的来说是,系统或Python工具安装的包位于各个 dist-packages 路径下,而用户手动安装的位于 site-packages。参考 Python 路径下 dist-packages site-packages 区别

转载于:https://my.oschina.net/leopardsaga/blog/173654

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值