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


- 使用公司代理使Python3.x Slack(松弛客户端) 2022-01-01
- 如何使用PYSPARK从Spark获得批次行 2022-01-01
- ";find_element_by_name(';name';)";和&QOOT;FIND_ELEMENT(BY NAME,';NAME';)";之间有什么区别? 2022-01-01
- 使用 Cython 将 Python 链接到共享库 2022-01-01
- YouTube API v3 返回截断的观看记录 2022-01-01
- 我如何透明地重定向一个Python导入? 2022-01-01
- 检查具有纬度和经度的地理点是否在 shapefile 中 2022-01-01
- 我如何卸载 PyTorch? 2022-01-01
- 计算测试数量的Python单元测试 2022-01-01
- CTR 中的 AES 如何用于 Python 和 PyCrypto? 2022-01-01