У меня есть сервис Django, и я недавно добавил в него OneLogin SSO. Все нормально работает на локальном компьютере, но на сервере, при входе в систему при каждом запросе создается ошибка ImportError.
ImportError: Interpreter change detected - this module can only be loaded into one interpreter per process.
Полная трассировка стека составляет
Traceback (most recent call last):
File "/.virtualenvs/dj/local/lib/python3.5/site-packages/django/core/handlers/exception.py", line 39, in inner
response = get_response(request)
File "/.virtualenvs/dj/local/lib/python3.5/site-packages/django/core/handlers/base.py", line 172, in _get_response
resolver_match = resolver.resolve(request.path_info)
File "/.virtualenvs/dj/local/lib/python3.5/site-packages/django/urls/resolvers.py", line 267, in resolve
for pattern in self.url_patterns:
File "/.virtualenvs/dj/local/lib/python3.5/site-packages/django/utils/functional.py", line 35, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/.virtualenvs/dj/local/lib/python3.5/site-packages/django/urls/resolvers.py", line 310, in url_patterns
patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/.virtualenvs/dj/local/lib/python3.5/site-packages/django/utils/functional.py", line 35, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/.virtualenvs/dj/local/lib/python3.5/site-packages/django/urls/resolvers.py", line 303, in urlconf_module
return import_module(self.urlconf_name)
File "/.virtualenvs/dj/lib64/python3.5/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 986, in _gcd_import
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 662, in exec_module
File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
File "./bwell_clientportal/urls.py", line 23, in <module>
from bwell_clientportal.apps.onelogin_sso import views as onelogin_views
File "./bwell_clientportal/apps/onelogin_sso/views.py", line 9, in <module>
from onelogin.saml2.auth import OneLogin_Saml2_Auth
File "/.virtualenvs/dj/local/lib/python3.5/site-packages/onelogin/saml2/auth.py", line 14, in <module>
import xmlsec
ImportError: Interpreter change detected - this module can only be loaded into one interpreter per process.
Я использую Python 3.5.1 с Django 1.11 и python3-saml
для единого входа.
Машина работает на AWS с использованием amazon AMI.