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"进行配置和编译?
基础教程推荐
- kivy 应用程序中的一个简单网页作为小部件 2022-01-01
- 究竟什么是“容器"?在蟒蛇?(以及所有的 python 容器类型是什么?) 2022-01-01
- matplotlib 设置 yaxis 标签大小 2022-01-01
- Kivy 使用 opencv.调整图像大小 2022-01-01
- 在 Django Admin 中使用内联 OneToOneField 2022-01-01
- 对多索引数据帧的列进行排序 2022-01-01
- Python,确定字符串是否应转换为 Int 或 Float 2022-01-01
- 比较两个文本文件以找出差异并将它们输出到新的文本文件 2022-01-01
- 在 Python 中将货币解析为数字 2022-01-01
- Python 中是否有任何支持将长字符串转储为块文字或折叠块的 yaml 库? 2022-01-01
