我想导入请求库(在 views.py 中)以从其他网站请求一些信息。但是有一个像标题这样的错误
在 ivews.py
from django.http import HttpResponse
from django.http import JsonResponse
from django.core import serializers
import requests
import json
AttributeError:cffi 库“_constant_time”没有名为“ spec ”的函数、常量或全局变量
上述异常是以下异常的直接原因:
Traceback(最近一次调用最后一次):文件“C:/Users/49646/Desktop/auto_order/manage.py”,第 21 行,在
.....如果不是 isinstance(module, ModuleType) 或 getattr(module, ' spec ', None) is None: SystemError: 返回一个带有错误集的结果