在pydev eclipse上的django interactive shell中出错 [英] Error in django interactive shell on pydev eclipse

查看:148
本文介绍了在pydev eclipse上的django interactive shell中出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我点击 django - > shell与django环境给我:

from django.core import management;
import test1.settings as settings;
management.setup_environ(settings)

错误是:


追溯(最近的最后一次呼叫):
文件,第1行,
AttributeError:'module'对象没有属性'setup_environ'

Traceback (most recent call last): File "", line 1, in AttributeError: 'module' object has no attribute 'setup_environ'




  • Eclipse 4.3.1

  • Python 2.6

  • Django 1.6

  • 有人可以帮助吗?

    推荐答案

    我在Django版本1.10.4在Eclipse Neon中使用PyDev 4.1。原因是首选项 - > PyDev - >交互控制台 - >初始命令中的脚本将Django版本1.10评估为小于1.5,并执行无效版本的Django的命令。解决方案的解决方案是删除所有Django解释器命令的错误版本,只执行1.7及以上的命令。

    I'm getting this on Django version 1.10.4 in Eclipse Neon with PyDev 4.1. The reason is that the script in Preferences -> PyDev -> Interactive Console -> Initial Commands evaluates Django version 1.10 as less than 1.5 and executes the commands for an invalid version of Django. The workaround solution is to delete all Django interpreter commands for the wrong version and only execute commands for version 1.7 and above.

    这篇关于在pydev eclipse上的django interactive shell中出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆