3

I'm trying to build python 2.5.2 on Solaris 8 using gcc 3.4.2. I can't see any immediate errors in the ./configure step but, once built and i enter the python shell doing an import time errors with :

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

What am i doing wrong? From what i can see with a cursory google is that there might be an error with libstdc++.so, but i can't find any hard details.

Any suggestions would be most welcome.

Many thanks,

Al.

AlMcLean
  • 3,459
  • 2
  • 19
  • 14
  • Where is Python installed? What is the PYTHONPATH? What is sys.path currently set to? – S.Lott Nov 24 '08 at 16:57
  • Hi, For just now i have it in a local directory. PYTHONPATH isn't set, sys.path is : /usr/local/lib/python25.zip', '~/src/Python-2.5.2/Lib', '~/src/Python-2.5.2/Lib/plat-sunos5', '~/src/Python-2.5.2/Lib/lib-tk', '~/src/Python-2.5.2/Modules', '~/src/Python-2.5.2/build/lib.solaris-2.8-sun4u-2.5 – AlMcLean Nov 25 '08 at 09:27
  • I shortened the paths slightly in the last comment to fit. – AlMcLean Nov 25 '08 at 09:28
  • @AlMcLean Can you please tell me how you got python-2.5 compiled on solaris 8? I'm trying to compile it for two days now. – Johannes Mar 29 '20 at 14:56

1 Answers1

2

The time module is not built by default in Python, if you build from a source distribution you need to explicitly enable all the modules you want to compile.

Open up Modules/Setup.dist in the python source tree and comment out the line which says:

#time timemodule.c

To enable the build of time module. Also remember that you need to recompile Python for this to take an effect.

Johan Dahlin
  • 25,300
  • 6
  • 40
  • 55