Roxana Ciobanu
Roxana Ciobanu

Reputation: 273

Importing time module in python3

I have a problem when trying to import the time module in python3.

Can someone give me some hints? I searched in the standard documentation and it says it should be always available.

The error I get is:

>>>import time
ImportError: No module named 'time'

Upvotes: 2

Views: 2239

Answers (1)

Sridhar Ratnakumar
Sridhar Ratnakumar

Reputation: 85372

time is a compiled shared object module. For example,

>>> import time
>>> time
<module 'time' from '/opt/ActivePython-2.7/lib/python2.7/lib-dynload/time.so'>

These shared object modules live under a specific directory (lib-dynload in the above case), which directory may not be in your $PYTHONPATH.

Upvotes: 2

Related Questions