django-geojson
django-geojson copied to clipboard
UWSGI crashes after installing django-geojson
Hi, i try to use django-geojson for one of my project with Using django 2.1.4 and Python 3.7. After installing the module, my UWSGI crashes.
I get the following traceback
*** Operational MODE: single process ***
mounting kobo_project.wsgi:application on /surveys
Traceback (most recent call last):
File "./kobo_project/wsgi.py", line 20, in <module>
application = get_wsgi_application()
File "/usr/local/lib/python3.7/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
django.setup(set_prefix=False)
File "/usr/local/lib/python3.7/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/usr/local/lib/python3.7/site-packages/django/apps/registry.py", line 120, in populate
app_config.ready()
File "/usr/local/lib/python3.7/site-packages/django/contrib/admin/apps.py", line 24, in ready
self.module.autodiscover()
File "/usr/local/lib/python3.7/site-packages/django/contrib/admin/__init__.py", line 26, in autodiscover
autodiscover_modules('admin', register_to=site)
File "/usr/local/lib/python3.7/site-packages/django/utils/module_loading.py", line 47, in autodiscover_modules
import_module('%s.%s' % (app_config.name, module_to_search))
File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/usr/local/lib/python3.7/site-packages/leaflet/admin.py", line 8, in <module>
from djgeojson.fields import GeoJSONField
File "/usr/local/lib/python3.7/site-packages/djgeojson/__init__.py", line 2, in <module>
from pkg_resources import DistributionNotFound
File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3126, in <module>
@_call_aside
File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3110, in _call_aside
f(*args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3139, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 572, in _build_master
ws = cls()
File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 565, in __init__
self.add_entry(entry)
File "/usr/local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 619, in add_entry
self.entry_keys.setdefault(entry, [])
TypeError: unhashable type: 'list'
unable to load app 0 (mountpoint='/surveys') (callable not found or import error)
Deinstalling django-geojson solves the issue. Do you have a hint how I can make use of your module?
I have the same issue with Django 2.2.5 and Python 3.7.
Traceback (most recent call last):
File "manage.py", line 21, in
The issue seems to be related to setuptools pkg_resources trying to import DistributionNotFound. Editing the init.py file for the package to remove the distro information and manually set the version resolves the issue. This may be an issue with setuptools configuration when running in virtual environments.