在Eclipse中创建的Django项目(PyDev)用完了命令行,而不是Eclipse

时间:2016-03-02 18:57:14

标签: python django eclipse

我在Eclipse中创建了一个Django项目。当我从commad行运行manage.py时,它运行得很好,但是当我在Eclipse中运行manage.py时,我得到下面的错误消息。该项目位于一个虚拟环境中,存储在" C:\ Users \ Johanna \ Envs \ myproject \ Scripts \ python.exe"。

   Traceback (most recent call last):
  File "C:\Users\Johanna\workspace\Hide and Seek Game\manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "C:\Users\Johanna\Envs\myproject\lib\site-packages\django\core\management\__init__.py", line 353, in execute_from_command_line
    utility.execute()
  File "C:\Users\Johanna\Envs\myproject\lib\site-packages\django\core\management\__init__.py", line 302, in execute
    settings.INSTALLED_APPS
  File "C:\Users\Johanna\Envs\myproject\lib\site-packages\django\conf\__init__.py", line 55, in __getattr__
    self._setup(name)
  File "C:\Users\Johanna\Envs\myproject\lib\site-packages\django\conf\__init__.py", line 43, in _setup
    self._wrapped = Settings(settings_module)
  File "C:\Users\Johanna\Envs\myproject\lib\site-packages\django\conf\__init__.py", line 99, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "C:\Users\Johanna\Envs\myproject\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 944, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 956, in _find_and_load_unlocked
ImportError: No module named 'Hide and Seek Game'

我很高兴为此提出建议。

1 个答案:

答案 0 :(得分:0)

我通过转到项目属性解决了这个问题 - &gt; PyDev Django并设置Django设置模块。 enter image description here