当我给来源烤面包机开始在morty时,imoprt错误

时间:2017-10-06 06:03:29

标签: django yocto

当我运行poky / build $ source toaster start时出现以下错误。

The system will start.
Traceback (most recent call last):
  File "/home/siva/yocto/Morty/poky/bitbake/bin/../lib/toaster/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
......   
 File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed



 File "/home/siva/.local/lib/python3.5/site-packages/django/contrib/contenttypes/apps.py", line 7, in <module>
 from .management import update_contenttypes  
    ImportError: cannot import name 'update_contenttypes'

我已经看到了以下链接,但我认为这与此不相符。

importerror: cannot import name update _all_content

2 个答案:

答案 0 :(得分:1)

我相信你正在使用像krogoth和morty这样的两个yocto来源。

krogoth取决于python2和pip
morty取决于python3和pip3
它可能会让事情变得混乱。所以请使用以下命令:

 rm -rf /home/siva/.local/lib/python3.5/site-packages/django

答案 1 :(得分:0)

你可以这样导入,

from YourPackageName.management import update_contenttypes