Python 2.5.2 和 Solaris 8 (gcc 3.4.2) 构建问题

标签 python gcc build-process solaris environment-variables

我正在尝试使用 gcc 3.4.2 在 Solaris 8 上构建 python 2.5.2。我在 ./configure 步骤中看不到任何直接错误,但是,一旦构建,我进入 python shell 执行导入时间错误:

Python 2.5.2 (r252:60911, Nov 21 2008, 18:45:42)
[GCC 3.4.2] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>> import time
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named time

我做错了什么?从我粗略的谷歌可以看出,libstdc++.so 可能有错误,但我找不到任何硬性细节。

欢迎提出任何建议。

非常感谢,

最佳答案

时间模块在 Python 中不是默认构建的,如果您从源代码分发中构建,您需要显式启用所有要编译的模块。

在 python 源代码树中打开 Modules/Setup.dist 并注释掉以下内容的行:

#time timemodule.c

启用时间模块的构建。还要记住,您需要重新编译 Python 才能生效。

关于Python 2.5.2 和 Solaris 8 (gcc 3.4.2) 构建问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/314749/

相关文章:

使用 -fprofile-generate 时的 gcc 宏

msbuild - tfs 构建过程很慢,需要很长时间才能完成

visual-studio-2008 - Visual Studio 2008 托管增量构建不起作用

python if wait then 语句

python - 在不知道其类的情况下通过 getattr 获取数据存储对象

python - BeautifulSoup - 按标签内的文本搜索

c - 有没有办法将 C11 编译为 C89?

macos - 在 Mac OS X 中链接 libusb

c++ - 如何在 Eclipse 中将我的项目从多个编译单元转变为单个编译单元

python - 检查Python代码是否仍在VM上运行