pycassa/pycassa — Issue #123: Import pycassa.types & import datetime issue
Author: danielcroft
Created: 2012-03-05 15:46:50+00:00
State: open

I'm seeing a problem in Python v2.7.1 with pycassa v1.5.1 where the order of imports is causing an AttributeError:

If the imports are in the following order:

```python
import datetime
from pycassa.types import *
```

There we see an error:

> Traceback (most recent call last):
> File "event_rollups.py", line 590, in
> sys.exit(main())
> File "event_rollups.py", line 491, in main
> hour_to_rollup = datetime.datetime.now()
> AttributeError: type object 'datetime.datetime' has no attribute 'datetime'

Reversing the order of imports as follows, works as expected:

```python
from pycassa.types import *
import datetime
```

The following SO thread may be related: http://stackoverflow.com/questions/5870702/strange-python-datetime-import-problem