Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Dates and Times in Python Dates and Times Today and Tomorrow

Frank Hoke
Frank Hoke
8,651 Points

datetime not working

when I try to use datetime in workspaces, I get 'Attribute Error: 'module' object has no attribute 'datetime'.

Also tried from datetime import datetime, that doesn't work either.

Also, can't get the workspace to start on the python dates and times lessons, it forces me back to a previous workspace.

Any ideas?

3 Answers

Kenneth Love
STAFF
Kenneth Love
Treehouse Guest Teacher

That's...strange. Are you, by any chance, trying to do this in a file named datetime.py?

Also, what video isn't letting you start a new workspace? All of them?

Frank Hoke
Frank Hoke
8,651 Points

I was trying to start a fresh workspace on the current lesson, can't remember which. Anyway, I found if I typed in a new name on the top box, it would open workspace on the new lesson. This is confusing because there was already text in the title for the current lesson, so I didn't see the need to put in another title to get the new space to open. Thanks for your help, Treehouse is awesome.

I'm having the same issue, except for the workspace not working.