小编gah*_*ooa的帖子

使用 --enable-shared 编译 Python 3.1.1

这是一个两管齐下的问题......问题的上下文是获得一个很好的 Python 3.1.1 构建以用于构建和运行 mod_wsgi。有关为什么共享库是个好主意的更多信息,请参阅此文档

使用 --enable-shared 构建 Python 的后果是什么?

我观察到当我在没有 --enable-shared 的情况下构建它时,python 二进制文件是 ~ 16MB

-rwxr-xr-x 2 root root 1638104 Aug 17 12:29 python3.1
Run Code Online (Sandbox Code Playgroud)

使用 --enable-shared,python 二进制文件为 15K。

-rwxr-xr-x 2 root root   15860 Oct  5 22:34 python3.1
Run Code Online (Sandbox Code Playgroud)

一般来说,这对python的“正常”操作有什么影响?所有脚本仍会运行相同吗?任何性能影响?您是否可以,或者是否希望同时拥有(共享和静态)?

关于如何干净地解决这个错误的任何想法?

注意:建立在干净的 RHEL 5.3 64 位安装上。

使用 构建 Python 3.1.1 后./configure --enable-shared,出现此错误:

[root@test ~]# python3
python3: error while loading shared libraries: 
libpython3.1.so.1.0: cannot open shared object file: No such file or directory
Run Code Online (Sandbox Code Playgroud)

我通过放置这个符号链接解决了它:

/usr/lib64/libpython3.1.so.1.0 -> /usr/local/lib/libpython3.1.so.1.0
Run Code Online (Sandbox Code Playgroud)

这似乎很骇人听闻......是否可以传递 …

python

5
推荐指数
1
解决办法
9439
查看次数

标签 统计

python ×1