我在我的机器上安装了ipython,如下面的虚拟环境
pip install ipython
Downloading/unpacking ipython
Downloading ipython-2.0.0.tar.gz (11.9MB): 11.9MB downloaded
Running setup.py egg_info for package ipython
Installing collected packages: ipython
Running setup.py install for ipython
checking package data
Installing ipengine2 script to /home/user/.virtualenvs/project/bin
Installing iptest script to /home/user/.virtualenvs/project/bin
Installing ipython2 script to /home/user/.virtualenvs/project/bin
Installing ipcluster2 script to /home/user/.virtualenvs/project/bin
Installing ipcluster script to /home/user/.virtualenvs/project/bin
Installing ipython script to /home/user/.virtualenvs/project/bin
Installing ipcontroller2 script to /home/user/.virtualenvs/project/bin
Installing ipcontroller script to /home/user/.virtualenvs/project/bin
Installing iptest2 script to /home/user/.virtualenvs/project/bin
Installing ipengine script to /home/user/.virtualenvs/project/bin
Successfully installed ipython
Cleaning up...
所以当我从virtualenv内部开始我的shell为python manage.py shell
我看到下面的错误
Traceback (most recent call last):
File "manage.py", line 11, in <module>
execute_manager(settings)
File "/home/user/.virtualenvs/project/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 438, in execute_manager
utility.execute()
File "/home/user/.virtualenvs/project/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/user/.virtualenvs/project/local/lib/python2.7/site-packages/django/core/management/base.py", line 191, in run_from_argv
self.execute(*args, **options.__dict__)
File "/home/user/.virtualenvs/project/local/lib/python2.7/site-packages/django/core/management/base.py", line 220, in execute
output = self.handle(*args, **options)
File "/home/user/.virtualenvs/project/local/lib/python2.7/site-packages/django/core/management/base.py", line 351, in handle
return self.handle_noargs(**options)
File "/home/user/.virtualenvs/project/local/lib/python2.7/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'
Django版本 - 1.2.3 在venv中的ipython版本 - 2.0.0
为什么它出现以及如何避免,我以前没有经历过这个
答案 0 :(得分:0)
我遇到了同样的问题。我通过将Django升级到1.2.7解决了这个问题。
pip install --upgrade django==1.2.7
如果那是不可能的,你可以尝试安装旧版本的IPython,但我还没有测试它是否有效。