После установки Django я выполнил учебник Игра с API. Когда я запустил следующую команду.
python manage.py shell
я получил это сообщение об ошибке.
File "/Library/Python/2.6/site-packages/django/core/management/commands/shell.py", line 29, in handle_noargs shell = IPython.Shell.IPShell(argv=[]) AttributeError: 'module' object has no attribute 'Shell'
Я проверил, что у меня есть модуль Shell.py и класс IPShell внутри него.
/Library/Python/2.6/site-packages/IPython/Shell.py
class IPShell:
"""Create an IPython instance."""
Что с этим не так? Мой IPython / Python / OS выглядит следующим образом.
>>> import IPython >>> IPython.Shell Traceback (most recent call last): File "", line 1, in AttributeError: 'module' object has no attribute 'Shell' >>> print IPython.__file__ /Library/Python/2.6/site-packages/IPython/__init__.py
С помощью ma3 и Игнасио , Я мог бы решить эту проблему.
Примените патч к django shell.py, как это сделал Игнасио.
попробуйте:
оболочка = IPython.InteractiveShell ()
кроме AttributeError:
# IPython