当我尝试在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'