Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3283874
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T20:05:28+00:00 2026-05-17T20:05:28+00:00

Running python on Snow Leopard, and I can’t import the ‘time’ module. Works in

  • 0

Running python on Snow Leopard, and I can’t import the ‘time’ module. Works in ipython. Don’t have any .pythonrc files being loaded. Scripts that ‘import time’ using the same interpreter run fine. Have no idea how to troubleshoot this. Anyone have an idea?

[wiggles@bananas ~]$ python2.6
Python 2.6.6 (r266:84292, Sep  1 2010, 14:27:13) 
[GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import time
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "time.py", line 4, in <module>
    t = now.strftime("%d-%m-%Y-%H-%M")
AttributeError: struct_time
>>> 
[wiggles@bananas ~]$ ipython-2.6 
Python 2.6.6 (r266:84292, Sep  1 2010, 14:27:13) 
Type "copyright", "credits" or "license" for more information.

IPython 0.10 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object'. ?object also works, ?? prints more.

In [1]: import time

In [2]: 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T20:05:28+00:00Added an answer on May 17, 2026 at 8:05 pm

    Look for a file called time.py. It looks like Python is importing that, instead of the one from the standard library:

      File "time.py", line 4, in <module>
    

    The solution is to rename the file something other than “time.py”.

    By the way, you can find the path to the offending file by opening a Python REPL and typing.

    In [1]: import time    
    In [2]: time.__file__   
    

    or

    In [3]: time     # This shows the path as part of the repr
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a long-running Python server and would like to be able to upgrade
Hey I have a windows server running python CGI scripts and I'm having a
I am running a windows machine have installed Python 2.5. I also used the
I'm running an Apache server (v2.2.10) with mod_python, Python 2.5 and Django. I have
Recently I upgraded to Snow Leopard, and now I can't run programs built with
I have a long-running Python script that I run from the command-line. The script
I simply want to install MySQL on my Mac (running Mac OS X 10.6.5 (Snow Leopard)) for
I'm running Python 2.6 on Unix and when I run the interactive prompt (
A python script is running two parallel python processes ( created via os.fork() )
I am currently running the following code based on Chapter 12.5 of the Python

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.