Python/Django error more meaningful on 2.7 than 3.

posted: 18 Sep 2013

Had a strange one today trying to start one of my Django sites after manually (i.e. not using adding a new app. I had added the and the but forgot the Trying to start that on Django under Python 3, I got this rather obscure (at least to me) error

AttributeError: 'module' object has no attribute '__file__'

Now that had me a little confused, until I tried running the exact same application using Python 2.7 and the error came back

ImportError: No module named tricurve

tricurve, being the name of the application I'd added was a great big clue here. I realized that I had simply not indicated that I wanted Python to consider tricurve as a module, which is done by creating a file. After doing that, it started fine under Python 2.7 and then, after switching back to Python 3, it started fine too.




There are currently no comments...

Submit a comment


Not displayed