'module' Object Has No Attribute 'OSMGeoAdmin'
The enviroment is as follows: **Windows 7** PATH=C:\Python27\;C:\Python27\Scripts;C:\Python27\Lib\site-packages\MySQLdb;C:\Program Files\MySQL\MySQL Server 5.5\bin;C:\OSGeo4W
Solution 1:
You need to import django.contrib.gis.admin
, not just admin
.
Solution 2:
I am 4 years late but I got this error after upgrading to osx El capitan and Homebrew. I found the solution here OSMGeoAdmin
relies on gdal so I had to reinstall it after upgrading by running
brew install gdal
.
hope this might help someone else in the future
Solution 3:
You need to run python manage.py shell
from the project directory, this loads the various django specific variables in your shell and will prevent the ImportError
.
EDIT:
Running it from a batch file and running it from the shell are not the same thing, which is why you are getting these errors.
The easiest way to solve the problem is to create a custom management command, which will avoid all these problems.
Post a Comment for "'module' Object Has No Attribute 'OSMGeoAdmin'"