我正在使用atom minicoda Django,当我尝试创建新项目时出现以下错误

时间:2020-07-20 11:54:56

标签: django atom-editor miniconda

当我尝试在Atom中创建新项目时出现以下错误。在使用django-admin startproject ABC命令之前,我安装了miniconda激活的虚拟环境,并安装了Django和Python。

 File "C:\Users\DELL\miniconda3\envs\MyEnv\Scripts\django-admin-script.py", line 9, in <module>
        sys.exit(execute_from_command_line())
      File "C:\Users\DELL\miniconda3\envs\MyEnv\lib\site-packages\django\core\management\__init__.py", line 401, in execute_from_command_lin
    e
        utility.execute()
      File "C:\Users\DELL\miniconda3\envs\MyEnv\lib\site-packages\django\core\management\__init__.py", line 395, in execute
        self.fetch_command(subcommand).run_from_argv(self.argv)
      File "C:\Users\DELL\miniconda3\envs\MyEnv\lib\site-packages\django\core\management\__init__.py", line 244, in fetch_command
        klass = load_command_class(app_name, subcommand)
      File "C:\Users\DELL\miniconda3\envs\MyEnv\lib\site-packages\django\core\management\__init__.py", line 37, in load_command_class
        module = import_module('%s.management.commands.%s' % (app_name, name))
      File "C:\Users\DELL\miniconda3\envs\MyEnv\lib\importlib\__init__.py", line 126, in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
      File "<frozen importlib._bootstrap>", line 985, in _gcd_import
      File "<frozen importlib._bootstrap>", line 968, in _find_and_load
    
      File "<frozen importlib._bootstrap>", line 957, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
      File "<frozen importlib._bootstrap_external>", line 697, in exec_module
      File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
      File "C:\Users\DELL\miniconda3\envs\MyEnv\lib\site-packages\django\core\management\commands\startproject.py", line 1, in <module>
        from django.core.management.templates import TemplateCommand
      File "C:\Users\DELL\miniconda3\envs\MyEnv\lib\site-packages\django\core\management\templates.py", line 14, in <module>
        from django.core.management.utils import handle_extensions
      File "C:\Users\DELL\miniconda3\envs\MyEnv\lib\site-packages\django\core\management\utils.py", line 7, in <module>
        from django.utilenter code heres.crypto import get_random_string
      File "C:\Users\DELL\miniconda3\envs\MyEnv\lib\site-packages\django\utils\crypto.py", line 6, in <module>
        import secrets
    ImportError: No module named 'secrets'

1 个答案:

答案 0 :(得分:1)

似乎您正在尝试将python <3.6与Django> = 3.0.0结合使用,它与documented不兼容。 Python <3.6没有secrets模块