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 :

import json

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

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

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

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 *