Is there a way to tell if python was configured and compiled with quot;--with-threads --enable-sharedquot;?(有没有办法判断 python 是否使用“--with-threads --enable-shared进行配置和编译?)
问题描述
这适用于 Debian Squeeez 上的 Python 2.6.6.我试图找出 debian 附带的二进制文件是否配置了以下标志:
--with-threads --enable-shared
好像它们不是我需要自己从源代码编译和安装.
--with-threads
(默认)表示Python支持线程,表示import thread
将工作.一个简单的测试方法是使用 python$version -m threading
--enable-shared
意味着 Python 带有一个 libpython$version.so
文件,安装在 $prefix/lib
中(与python$version
目录,不在其中.)最简单的方法是查看该文件是否存在——假设您想知道,因为您需要使用这个 libpython 共享库.如果你真的需要知道 python$version
binary 是否使用这个共享库,ldd
会告诉你.我做出这样的区分是因为在 Debian 上,即使 /usr/bin/python$version
是静态链接的,/usr/lib/python$version.so
也会存在.p>
This is for Python 2.6.6 on Debian Squeeez. I'm trying to find out if the binaries shipped with debian were configured with the flags of:
--with-threads --enable-shared
as if they were not I will need to compile and install from source myself.
--with-threads
(which is the default) will mean Python supports threading, which will mean import thread
will work. An easy way to test this is with python$version -m threading
--enable-shared
will mean Python comes with a libpython$version.so
file, installed in $prefix/lib
(alongside the python$version
directory, not inside it.) The easiest thing to do is to look if that file is there -- assuming you want to know because you need to use this libpython shared library. If you actually need to know if the python$version
binary uses this shared library, ldd
will tell you that. I make that distinction because on Debian, /usr/lib/python$version.so
will exist even though /usr/bin/python$version
is statically linked.
这篇关于有没有办法判断 python 是否使用“--with-threads --enable-shared"进行配置和编译?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:有没有办法判断 python 是否使用“--with-threads --enable-shared"进行配置和编译?


基础教程推荐
- 使用大型矩阵时禁止 Pycharm 输出中的自动换行符 2022-01-01
- 在同一图形上绘制Bokeh的烛台和音量条 2022-01-01
- 求两个直方图的卷积 2022-01-01
- 无法导入 Pytorch [WinError 126] 找不到指定的模块 2022-01-01
- Plotly:如何设置绘图图形的样式,使其不显示缺失日期的间隙? 2022-01-01
- 修改列表中的数据帧不起作用 2022-01-01
- PANDA VALUE_COUNTS包含GROUP BY之前的所有值 2022-01-01
- 包装空间模型 2022-01-01
- PermissionError: pip 从 8.1.1 升级到 8.1.2 2022-01-01
- 在Python中从Azure BLOB存储中读取文件 2022-01-01