AttributeError: ‘module’ object has no attribute

Switch to Dreamhost, and we will move your web site. No kidding.

Are you getting this type of error in your Python program?

AttributeError: ‘module’ object has no attribute ‘whatever’ ? 

Well, then you might need to change the name of your python file.

For example, save the following code in a file named json.py :

 
import json

print json.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}])

Then try to run it, and you will get this error :

$ python json.py 
Traceback (most recent call last):
  File "json.py", line 1, in
    import json
  File...

A historical timeline of Codango™

Original Source

#codango #developer #development #coder #coding

We're happy to share this resource that we found. The content displayed on this page is property of it's original author and/or their organization.

 

Leave a Reply

Your email address will not be published. Required fields are marked *

*