Python 的 bz2 模块默认不编译

2022-01-17 00:00:00 python c compiler-construction

问题描述

看来Python 2.6.1默认不从源码编译bz2库.

It seems that Python 2.6.1 doesn't compile bz2 library by default from source.

我没有 lib-dynload/bz2.so

I don't have lib-dynload/bz2.so

添加它的最快方法是什么(无需从头开始安装 Python)?

What's the quickest way to add it (without installing Python from scratch)?

操作系统是 Linux 2.4.32-grsec+f6b+gr217+nfs+a32+fuse23+tg+++opt+c8+gr2b-v6.194 #1 SMP Tue Jun 6 15:52:09 PDT 2006 i686 GNU/Linux

OS is Linux 2.4.32-grsec+f6b+gr217+nfs+a32+fuse23+tg+++opt+c8+gr2b-v6.194 #1 SMP Tue Jun 6 15:52:09 PDT 2006 i686 GNU/Linux

IIRC 我只使用了 --prefix 标志.

IIRC I used only --prefix flag.


解决方案

您需要首先正确安装 libbz2.so(通用 libbz2 库),以便 Python 能够构建自己的接口.这通常来自您的 Linux 发行版中的一个包,包名中可能包含libbz2"和dev".

You need libbz2.so (the general purpose libbz2 library) properly installed first, for Python to be able to build its own interface to it. That would typically be from a package in your Linux distro likely to have "libbz2" and "dev" in the package name.

相关文章