当我在 morty 中启动源烤面包机时出现导入错误
imoprt error when I gave source toaster start in morty
当我 运行 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'
我看过下面的 link 但我认为这与此不同。
你可以这样导入,
from YourPackageName.management import update_contenttypes
我相信您正在使用两个 yocto 来源,例如 krogoth 和 morty。
krogoth
取决于 python2 和 pip
morty
取决于 python3 和 pip3
它可能混淆了事情。所以请使用以下命令:
rm -rf /home/siva/.local/lib/python3.5/site-packages/django
当我 运行 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'
我看过下面的 link 但我认为这与此不同。
你可以这样导入,
from YourPackageName.management import update_contenttypes
我相信您正在使用两个 yocto 来源,例如 krogoth 和 morty。
krogoth
取决于 python2 和 pip
morty
取决于 python3 和 pip3
它可能混淆了事情。所以请使用以下命令:
rm -rf /home/siva/.local/lib/python3.5/site-packages/django