ImportError:没有名为robots的模块

时间:2015-08-10 15:23:02

标签: python django virtualenv

当我尝试启动服务器时,发生了以下错误:

ImportError: No module named robots

我试过使用pip:

pip install robots

但没有这样的模块

回溯如下:

(env) U:\Python\mdknowledge>python manage.py runserver 0.0.0.0:8000
        Traceback (most recent call last):
          File "manage.py", line 8, in <module>
            execute_from_command_line(sys.argv)
          File "U:\Python\mdknowledge\env\lib\site-packages\django\core\management\__ini
        t__.py", line 399, in execute_from_command_line
            utility.execute()
          File "U:\Python\mdknowledge\env\lib\site-packages\django\core\management\__ini
        t__.py", line 392, in execute
            self.fetch_command(subcommand).run_from_argv(self.argv)
          File "U:\Python\mdknowledge\env\lib\site-packages\django\core\management\base.
        py", line 242, in run_from_argv
            self.execute(*args, **options.__dict__)
          File "U:\Python\mdknowledge\env\lib\site-packages\django\core\management\base.
        py", line 280, in execute
            translation.activate('en-us')
          File "U:\Python\mdknowledge\env\lib\site-packages\django\utils\translation\__i
        nit__.py", line 130, in activate
            return _trans.activate(language)
          File "U:\Python\mdknowledge\env\lib\site-packages\django\utils\translation\tra
        ns_real.py", line 188, in activate
            _active.value = translation(language)
          File "U:\Python\mdknowledge\env\lib\site-packages\django\utils\translation\tra
        ns_real.py", line 177, in translation
            default_translation = _fetch(settings.LANGUAGE_CODE)
          File "U:\Python\mdknowledge\env\lib\site-packages\django\utils\translation\tra
        ns_real.py", line 159, in _fetch
            app = import_module(appname)
          File "U:\Python\mdknowledge\env\lib\site-packages\django\utils\importlib.py",
        line 40, in import_module
            __import__(name)
        ImportError: No module named robots

试试pip:

        (env) U:\Python\mdknowledge>pip install robots
        Collecting robots
          Could not find a version that satisfies the requirement robots (from versions:
         )
        No matching distribution found for robots

1 个答案:

答案 0 :(得分:1)

pip install django-robots

阅读install说明