gpt4 book ai didi

django - 为什么 Aptana 3 (OS X) 在导入的项目中找不到 django 设置模块?

转载 作者:行者123 更新时间:2023-12-01 01:19:54 25 4
gpt4 key购买 nike

我刚开始在家中从事基于 aptana 的 django 项目。该项目在我工作中的基于 Windows 的机器上运行良好,部分在我家里的 Mac 上运行。

当我跑

python manage.py runserver



从命令行,我的 django 项目工作正常。但是,当我尝试通过 aptana 调试/运行界面运行它时(设置方式与我在工作中设置配置的方式相同),我收到以下消息:

pydev debugger: starting Traceback (most recent call last): File "/Applications/Aptana Studio 3/plugins/org.python.pydev.debug_2.4.0.2012020116/pysrc/pydevd.py", line 1307, in debugger.run(setup['file'], None, None) File "/Applications/Aptana Studio 3/plugins/org.python.pydev.debug_2.4.0.2012020116/pysrc/pydevd.py", line 1060, in run pydev_imports.execfile(file, globals, locals) #execute the script File "/Users/michael/Documents/Aptana Studio 3 Workspace/video-encoder-interface/src/VideoEncoderInterface/manage.py", line 14, in execute_manager(settings) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/init.py", line 459, in execute_manager utility.execute() File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/init.py", line 382, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/init.py", line 261, in fetch_command klass = load_command_class(app_name, subcommand) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/init.py", line 69, in load_command_class module = import_module('%s.management.commands.%s' % (app_name, name)) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module import(name) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 8, in from django.core.servers.basehttp import AdminMediaHandler, run, WSGIServerException, get_internal_wsgi_application File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/servers/basehttp.py", line 26, in from django.views import static File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/views/static.py", line 95, in template_translatable = ugettext_noop(u"Index of %(directory)s") File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/utils/translation/init.py", line 75, in gettext_noop return _trans.gettext_noop(message) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/utils/translation/init.py", line 48, in getattr if settings.USE_I18N: File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/utils/functional.py", line 184, in inner self._setup() File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/conf/init.py", line 42, in _setup self._wrapped = Settings(settings_module) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/conf/init.py", line 95, in init raise ImportError("Could not import settings '%s' (Is it on sys.path?): %s" % (self.SETTINGS_MODULE, e)) ImportError: Could not import settings 'video-encoder-interface.settings' (Is it on sys.path?): No module named video-encoder-interface.settings



我注意到的一件事可能是错误的(我也不知道如何修复它),最后一行是指 video-encoder-interface.settings,我认为它应该在其中寻找 VideoEncoderInterface,因为这就是名称包的(video-encoder-interface只是aptana项目目录的目录名)

最佳答案

可能您的 PYTHONPATH 没有在 Eclipse/PyDev 中正确设置...或者设置模块不正确(右键单击项目 > 属性 > pydev - django:django 设置模块应该在那里正确设置)。

如果您仍然无法找到它,请将 pydev 包资源管理器的屏幕截图与您的项目配置一起发布,并发布您的 manage.py 文件的内容。

关于django - 为什么 Aptana 3 (OS X) 在导入的项目中找不到 django 设置模块?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10055916/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com