一般搜索一下 No module named ... 看看少了什么库
python报这个错误如何解决
python3 manage.py runserver
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/django/core/management/__init__.py", line 357, in execute
autoreload.check_errors(django.setup)()
File "/usr/local/lib/python3.5/dist-packages/django/utils/autoreload.py", line 53, in wrapper
fn(*args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/django/__init__.py", line 16, in setup
from django.urls import set_script_prefix
File "/usr/local/lib/python3.5/dist-packages/django/urls/__init__.py", line 1, in
from .base import (
File "/usr/local/lib/python3.5/dist-packages/django/urls/base.py", line 9, in
from .exceptions import NoReverseMatch, Resolver404
File "/usr/local/lib/python3.5/dist-packages/django/urls/exceptions.py", line 1, in
from django.http import Http404
File "/usr/local/lib/python3.5/dist-packages/django/http/__init__.py", line 2, in
from django.http.request import (
File "/usr/local/lib/python3.5/dist-packages/django/http/request.py", line 10, in
from django.core import signing
File "/usr/local/lib/python3.5/dist-packages/django/core/signing.py", line 45, in
from django.utils.crypto import constant_time_compare, salted_hmac
File "/usr/local/lib/python3.5/dist-packages/django/utils/crypto.py", line 6, in
import secrets
ImportError: No module named 'secrets'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "manage.py", line 15, in
execute_from_command_line(sys.argv)
File "/usr/local/lib/python3.5/dist-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python3.5/dist-packages/django/core/management/__init__.py", line 370, in execute
parser = self.fetch_command('runserver').create_parser('django', 'runserver')
File "/usr/local/lib/python3.5/dist-packages/django/core/management/_init__.py", line 244, in fetch_command
klass = load_command_class(app_name, subcommand)
File "/usr/local/lib/python3.5/dist-packages/django/core/management/__init__.py", line 37, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
return bootstrap._gcd_import(name[level:], package, level)
File "", line 986, in _gcd_import
File "", line 969, in _find_and_load
File "", line 958, in _find_and_load_unlocked
File "", line 673, in _load_unlocked
File "", line 665, in exec_module
File "", line 222, in _call_with_frames_removed
File "/usr/local/lib/python3.5/dist-packages/django/core/management/commands/runserver.py", line 10, in
from django.core.servers.basehttp import (
File "/usr/local/lib/python3.5/dist-packages/django/core/servers/basehttp.py", line 17, in
from django.core.handlers.wsgi import LimitedStream
File "/usr/local/lib/python3.5/dist-packages/django/core/handlers/wsgi.py", line 6, in
from django.core.handlers import base
File "/usr/local/lib/python3.5/dist-packages/django/core/handlers/base.py", line 8, in
from django.urls import get_resolver, set_urlconf
File "/usr/local/lib/python3.5/dist-packages/django/urls/_init__.py", line 1, in
from .base import (
File "/usr/local/lib/python3.5/dist-packages/django/urls/base.py", line 9, in
from .exceptions import NoReverseMatch, Resolver404
File "/usr/local/lib/python3.5/dist-packages/django/urls/exceptions.py", line 1, in
from django.http import Http404
File "/usr/local/lib/python3.5/dist-packages/django/http/__init__.py", line 2, in
from django.http.request import (
File "/usr/local/lib/python3.5/dist-packages/django/http/request.py", line 10, in
from django.core import signing
File "/usr/local/lib/python3.5/dist-packages/django/core/signing.py", line 45, in
from django.utils.crypto import constant_time_compare, salted_hmac
File "/usr/local/lib/python3.5/dist-packages/django/utils/crypto.py", line 6, in
import secrets
ImportError: No module named 'secrets'
- 点赞
- 写回答
- 关注问题
- 收藏
- 复制链接分享
- 邀请回答
3条回答
为你推荐
- 关于python的爬虫问题
- python
- 3个回答
- python引用xlwings出问题,这个报错什么意思 ,怎么解决,谢谢大佬
- python
- 4个回答
- python pandas报错TypeError
- 开发语言
- python
- 20个回答
- python编程中关于pandas 读取xlsx文件的报错问题
- python
- 1个回答
- 求大佬解决Python问题中的EOF报错问题
- python
- 1个回答
- 老师 打包一直报RecursionError: maximum recursion depth exceeded while calling a Python object这个错误 添加了import sys和sys.setrecursionlimit(1000000) 还是报这个错,请问该怎么解决啊。
- python
- 2个回答
- [已解决]python3环境下出现socket.gaierror: [Errno 10109] getaddrinfo failed
- 开发语言
- tornado
- python
- 2个回答
- python使用Opencv实现人脸识别进行人脸数据训练时,为什么总是报文件无法打开的错误?
- python
- 2个回答
- 执行python manage.py runserver 0.0.0.0:8000无响应
- python
- django
- 1个回答
- python3远程连接执行接口测试,返回错误405,但是本地调试和postman直接调用都没有问题
- python
- postman
- 3个回答
- list是一个空的 为空 如何防止 python 报错?IndexError: list index out of range
- list
- python
- 2个回答
- Pyinstaller打包程序,运行could not find QtWebEngineProcess.exe错误,求大神解决办法?
- 开发语言
- python
- 1个回答
- 安装python第三方库segyio时出错
- python/安装库
- 2个回答
- python字典配合占位符出错
- python
- 1个回答
- python怎么做弹出框
- python
- 0个回答
- python中ModuleNotFoundError错误
- python
- 3个回答
- python启动http服务器出现unicodeDecodeError怎么解决
- python
- http服务器
- 6个回答
- 在python中写main(args)为啥老是报错?
- python
- 4个回答
- jupyter notebook命令行运行错误,请大神们帮助解决
- jupyter
- python
- 1个回答
- 用eclipse 写python时报错
- python
- 1个回答