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"进行配置和编译?


基础教程推荐
- 何时使用 os.name、sys.platform 或 platform.system? 2022-01-01
- Python kivy 入口点 inflateRest2 无法定位 libpng16-16.dll 2022-01-01
- 筛选NumPy数组 2022-01-01
- 使用PyInstaller后在Windows中打开可执行文件时出错 2022-01-01
- 如何在海运重新绘制中自定义标题和y标签 2022-01-01
- 线程时出现 msgbox 错误,GUI 块 2022-01-01
- Dask.array.套用_沿_轴:由于额外的元素([1]),使用dask.array的每一行作为另一个函数的输入失败 2022-01-01
- 用于分类数据的跳跃记号标签 2022-01-01
- 如何让 python 脚本监听来自另一个脚本的输入 2022-01-01
- 在 Python 中,如果我在一个“with"中返回.块,文件还会关闭吗? 2022-01-01