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 7444989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:42:44+00:00 2026-05-29T11:42:44+00:00

I am a little bit confused as to why I am receiving the error

  • 0

I am a little bit confused as to why I am receiving the error AttributeError: ‘module’ object has no attribute ‘strptime’. When I import datetime in my Python script and call datetime.datetime.strptime(string, format) everything works fine but when I write from datetime import datetime and call datetime.strptime(string, format) my script crashes with the above error. I am fine using import datetime and calling datetime.datetime but I am still curious as to why from datetime import datetime crashes on the call datetime.strptime(string, format). Any ideas as to why this might be happening? My code is below…

Bulkolader.yaml

python_preamble:
- import: re
- import: base64

- import: hs_transformers

- import: google.appengine.ext.db
- import: google.appengine.ext.bulkload.transform
- import: google.appengine.ext.bulkload.bulkloader_wizard

- import: google.appengine.api.datastore


transformers:

- kind: HBO
  connector: csv

  property_map:
    - property: __key__
      external_name: swfServerID
      import_transform: hs_transformers.string

    - property: IP_address
      external_name: IP
      import_transform: hs_transformers.string

    - property: name
      external_name: swfServer
      import_transform: hs_transformers.swfServer

    - property: checkin
      external_name: clockStampOfLastCheckin
      import_transform: hs_transformers.date_time

    - property: update
      external_name: clockStampOfLastUpdate
      import_transform: hs_transformers.clockStampOfLastUpdate

    - property: form_factor
      external_name: formFactor
      import_transform: hs_transformers.string

    - property: serial_number
      external_name: serialNumber
      import_transform: hs_transformers.string

    - property: reverse_SSH
      external_name: allowReverseSSH
      import_transform: hs_transformers.boolean

    - property: insight_account
      external_name: FK_insightAccountID
      import_transform: hs_transformers.integer

    - property: version
      external_name: ver
      import_transform: hs_transformers.string

hs_transformers.py

import re
import logging
from datetime import datetime
from shared.datastore import *
import google.appengine.ext.bulkload.transform
from google.appengine.api import memcache


def clockStampOfLastUpdate(passed_clockstamp):
    try:
        if passed_clockstamp != "NULL":
            datetime_object = date_time(passed_clockstamp)
            return_file_update = memcache.get(str(datetime_object), namespace = "HBOImport")

            if not return_file_update:
                return_file_update = FileUpdate.lastBefore(datetime_object)
                memcache.set(str(datetime_object), return_file_update, namespace = "HBOImport", time = 20)

            if return_file_update != None: return return_file_update.key()
    except Exception, e: 
        logging.error(e)


def string(passed_string):
    try: 
        if passed_string != "NULL": return passed_string
    except Exception, e: 
        logging.error(e)


def swfServer(passed_url):
    try:
        if passed_url != "NULL": return passed_url.split('//', 1)[1].split('.')[0]
    except Exception, e: 
        logging.error(e)


def date_time(passed_datetime):
    try:
        if passed_datetime != "NULL": return datetime.strptime(passed_datetime, '%m/%d/%y %H:%M')
    except Exception, e: 
        logging.error(e) 


def boolean(passed_boolean):
    try:
        if passed_boolean != "NULL": 
            if passed_boolean == "T": return True
            if passed_boolean == "F": return False
    except Exception, e: 
        logging.error(e)


def integer(passed_integer):
    try:
        if passed_integer != "NULL": return int(passed_integer)
    except Exception, e: 
        logging.error(e)

cmd error…

Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\Jack Frost>cd "C:\Program Files (x86)\Google App Engine SDK"

C:\Program Files (x86)\Google App Engine SDK>python appcfg.py upload_data --url=http://bulkloader-testing.appspot.com/remote_api --config_file="C:\Users\Jack Frost\Eclipse Workspace\Headsprout\GAE 2.1.2012\src\utilities\bulkloader\bulkloader.yaml" --filename="C:\Users\Jack Frost\Eclipse Workspace\Headsprout\GAE 2.1.2012\src\utilities\bulkloader\csv_files\small_hbos.csv" --kind=HBO
Uploading data records.
[INFO    ] Logging to bulkloader-log-20120207.105053
[INFO    ] Throttling transfers:
[INFO    ] Bandwidth: 250000 bytes/second
[INFO    ] HTTP connections: 8/second
[INFO    ] Entities inserted/fetched/modified: 20/second
[INFO    ] Batch Size: 10
[INFO    ] Opening database: bulkloader-progress-20120207.105053.sql3
[INFO    ] Connecting to bulkloader-testing.appspot.com/remote_api
[INFO    ] Starting import; maximum 10 entities per post
PASSED DATETIME 2/1/12 17:52
TYPE <type 'unicode'>
[ERROR   ] [WorkerThread-0] WorkerThread:
Traceback (most recent call last):
  File "C:\Program Files (x86)\Google App Engine SDK\google\appengine\tools\adaptive_thread_pool.py", line 176, in WorkOnItems
status, instruction = item.PerformWork(self.__thread_pool)
  File "C:\Program Files (x86)\Google App Engine SDK\google\appengine\tools\bulkloader.py", line 764, in PerformWork
transfer_time = self._TransferItem(thread_pool)
  File "C:\Program Files (x86)\Google App Engine SDK\google\appengine\tools\bulkloader.py", line 933, in _TransferItem
self.content = self.request_manager.EncodeContent(self.rows)
  File "C:\Program Files (x86)\Google App Engine SDK\google\appengine\tools\bulkloader.py", line 1394, in EncodeContent
entity = loader.create_entity(values, key_name=key, parent=parent)
  File "C:\Program Files (x86)\Google App Engine SDK\google\appengine\ext\bulkload\bulkloader_config.py", line 445, in create_entity
entity = self.dict_to_entity(input_dict, self.bulkload_state)
  File "C:\Program Files (x86)\Google App Engine SDK\google\appengine\ext\bulkload\bulkloader_config.py", line 147, in dict_to_entity
self.__run_import_transforms(input_dict, instance, bulkload_state_copy)
  File "C:\Program Files (x86)\Google App Engine SDK\google\appengine\ext\bulkload\bulkloader_config.py", line 252, in __run_import_transforms
value = self.__dict_to_prop(transform, input_dict, bulkload_state)
  File "C:\Program Files (x86)\Google App Engine SDK\google\appengine\ext\bulkload\bulkloader_config.py", line 207, in __dict_to_prop
value = transform.import_transform(value)
  File "C:\Program Files (x86)\Google App Engine SDK\google\appengine\ext\bulkload\bulkloader_parser.py", line 111, in __call__
return self.method(*args, **kwargs)
  File "C:\Users\Jack Frost\Eclipse Workspace\Headsprout\GAE 2.1.2012\src\utilities\bulkloader\hs_transformers.py", line 44, in date_time
print datetime.strptime(passed_datetime, '%m/%d/%y %H:%M')
AttributeError: 'module' object has no attribute 'strptime'
[INFO    ] [WorkerThread-1] Backing off due to errors: 1.0 seconds
[INFO    ] An error occurred. Shutting down...
[ERROR   ] Error in WorkerThread-0: 'module' object has no attribute 'strptime'

[INFO    ] 10 entities total, 0 previously transferred
[INFO    ] 0 entities (1516 bytes) transferred in 3.0 seconds
[INFO    ] Some entities not successfully transferred
  • 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-29T11:42:45+00:00Added an answer on May 29, 2026 at 11:42 am

    Perhaps

    from shared.datastore import *
    

    is redefining datetime to be the module.

    You can check this guess by putting print statements in your code

    from datetime import datetime
    print(datetime)
    from shared.datastore import *
    print(datetime)
    

    and seeing if the value of datetime has changed.

    If my guess is wrong, you can still use print statements to “bisect” your code until you find which line is changing the value of datetime.

    (Whatever the case, it is preferable to not use the wildcard form of import, since it can be a source of these weird bugs.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am a little bit confused about 2 things. Firstly when I create an
I'm a little bit confused. I want to start learn Flex3 with Eclipse and
I am a little bit confused on something, see I am doing an Ajax
I am a little bit confused by the PHP function declare . What exactly
I am a little bit confused with Doctrine class. I created a class and
I´m a little bit confused by reading all the posts and tutorials about starting
I'm a little bit confused on how handle memory management when dealing with graphics
I am little bit confused about this statement that I read in a book
I am little bit confused about following problem & their solutions: i have 2
I'm a little bit confused with Html helpers in MVC3. I used this syntax

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.