python - 在 python2 中编译 bz2 支持

标签 python python-2.7 gcc installation compression

我有

$ lsb_release -a
LSB Version:    :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: CentOS
Description:    CentOS release 6.6 (Final)
Release:    6.6
Codename:   Final

$ ls -l /lib64/libbz2.so.1
lrwxrwxrwx. 1 root root 15 May 25  2016 /lib64/libbz2.so.1 -> libbz2.so.1.0.4

我做到了:

Python-2.7.12 $ export LDFLAGS="-L/lib64";  ./configure --prefix=/some/dir

Python-2.7.12 $ make

得到:

Python build finished, but the necessary bits to build these modules were not found:
_sqlite3           _tkinter           bsddb185
bz2                dl                 imageop

如何构建对 bz2 模块的支持?

最佳答案

wget http://bzip.org/1.0.6/bzip2-1.0.6.tar.gz
tar -xvf bzip2-1.0.6.tar.gz
cd bzip2-1.0.6
make -f Makefile-libbz2_so
make
make install PREFIX=/some/dir

cd Python-2.7.3
./configure --prefix=/some/dir
make install

这对我有用。

从此处复制说明:Compile Python with bz2 support

关于python - 在 python2 中编译 bz2 支持,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46384018/

相关文章:

Python 生成子子进程、分离和退出

python - python 的正则表达式模块中 `.*` 的含义 - 我认为它意味着任何数量的东西?

python - 将训练和测试数据保存在文件中

image - 使用 Tkinter 在标签图像上叠加一个框

c - 用于 Delphi ShareMem 应用程序的 GCC dll

gcc - 如何更改 crti.o 的 GCC 默认搜索目录?

python - Visual C++ 调试库命名约定

python - 如何使用 matlab 引擎 API 从 python 调用 matlab 函数文件?

python - 重定向后 Django 消息不显示

c - 默认情况下,gcc 链接到静态或动态标准库吗?