我正在尝试使用python3调试错误。以下是模块的版本以及我尝试运行python3 manage.py migration
时出现的错误下面是我们得到的错误。任何建议或帮助对此表示赞赏。
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/home/pcrs/.virtualenvs/pcrsenv/lib/python3.6/site-packages/django/core/management/__init__.py", line 363, in execute_from_command_line
utility.execute()
File "/home/pcrs/.virtualenvs/pcrsenv/lib/python3.6/site-packages/django/core/management/__init__.py", line 337, in execute
django.setup()
File "/home/pcrs/.virtualenvs/pcrsenv/lib/python3.6/site-packages/django/__init__.py", line 27, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/pcrs/.virtualenvs/pcrsenv/lib/python3.6/site-packages/django/apps/registry.py", line 108, in populate
app_config.import_models()
File "/home/pcrs/.virtualenvs/pcrsenv/lib/python3.6/site-packages/django/apps/config.py", line 202, in import_models
self.models_module = import_module(models_module_name)
File "/home/pcrs/.virtualenvs/pcrsenv/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/pcrs/pcrs/pcrs/problems_python/models.py", line 15, in <module>
import python_ta
File "/home/pcrs/.virtualenvs/pcrsenv/lib/python3.6/site-packages/python_ta/__init__.py", line 30, in <module>
from .patches import patch_all
File "/home/pcrs/.virtualenvs/pcrsenv/lib/python3.6/site-packages/python_ta/patches/__init__.py", line 4, in <module>
from .type import patch_type_inference_transform
File "/home/pcrs/.virtualenvs/pcrsenv/lib/python3.6/site-packages/python_ta/patches/type.py", line 4, in <module>
from ..transforms.type_inference_visitor import TypeInferer
File "/home/pcrs/.virtualenvs/pcrsenv/lib/python3.6/site-packages/python_ta/transforms/type_inference_visitor.py", line 5, in <module>
from typing import CallableMeta, TupleMeta, Union, _gorg, _geqv, _ForwardRef
ImportError: cannot import name '_gorg'
答案 0 :(得分:0)
您将需要升级python-ta软件包。
当前稳定版本中的transforms中的type_interface_visitor.py似乎不包含您的程序从-处出错的行,而是从其自身的内部模块中导入_gorg。
希望有帮助!