在从 Django1.5 迁移到 Django2.1.7 的过程中,我们在尝试启动服务器时遇到了库函数中的隐式导入错误。
Traceback (most recent call last):
Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x10945f950>
Traceback (most recent call last):
File "/Users/MAK/Envs/lifemed3/lib/python3.7/site-packages/django/utils/autoreload.py", line 225, in wrapper
fn(*args, **kwargs)
File "/Users/MAK/Envs/lifemed3/lib/python3.7/site-packages/django/core/management/commands/runserver.py", line 109, in inner_run
autoreload.raise_last_exception()
File "/Users/MAK/Envs/lifemed3/lib/python3.7/site-packages/django/utils/autoreload.py", line 248, in raise_last_exception
raise _exception[1]
File "/Users/MAK/Envs/lifemed3/lib/python3.7/site-packages/django/core/management/__init__.py", line 337, in execute
autoreload.check_errors(django.setup)()
File "/Users/MAK/Envs/lifemed3/lib/python3.7/site-packages/django/utils/autoreload.py", line 225, in wrapper
fn(*args, **kwargs)
File "/Users/MAK/Envs/lifemed3/lib/python3.7/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/Users/MAK/Envs/lifemed3/lib/python3.7/site-packages/django/apps/registry.py", line 89, in populate
app_config = AppConfig.create(entry)
File "/Users/MAK/Envs/lifemed3/lib/python3.7/site-packages/django/apps/config.py", line 90, in create
module = import_module(entry)
File "/Users/MAK/Envs/lifemed3/lib/python3.7/importlib/__init__.py", line 127, in import_module
我们已经检查了关于循环依赖的这个答案,但是因为它是在代码级别并且很容易解决,但是就库而言,解决这个问题的最佳方法是什么?
仅供参考:我们正在使用 Django2.1.7 从 python 2.7 和 django 1.5.5 迁移到 python3.7
更新(已解决)
根据下面mfrackowiak 的回答,我们必须 fork 他们的repo,为支持应用补丁并从更改后的版本安装。然后它对我有用
慕慕森
精慕HU
相关分类