简体   繁体   中英

python3 django manage.py migrate error _gorg

I am trying to debug an error with python3. Below are versions of modules and the error when I try to run python3 manage.py migrate

  • Python 3.6.5
  • python-ta 1.2.0

Below the error we are getting. Any advice or help on this appreciated.

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'

You will need to upgrade your python-ta package.

The type_interface_visitor.py in transforms in the current stable release seems not to contain the line where your program is erroring from - and is instead importing _gorg from its own internal modules.

Hope that helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM