IndexError: Cannot choose from an empty sequence // Werkzeug Debugger var CONSOLE_MODE = false, EVALEX = true, EVALEX_TRUSTED = false, SECRET = "Cztug1SITH6VWk19YYTC";
IndexError
IndexError: Cannot choose from an empty sequence
Traceback(most recent call last)
The above exception was the direct cause of the following exception:File "/usr/local/python3/lib/python3.7/site-packages/flask/app.py", line2551, in__call__
def __call__(self, environ: dict, start_response: t.Callable) -> t.Any:
"""The WSGI server calls the Flask application object as the
WSGI application. This calls :meth:`wsgi_app`, which can be
wrapped to apply middleware.
"""
return self.wsgi_app(environ, start_response)
File "/usr/local/python3/lib/python3.7/site-packages/flask/app.py", line2531, inwsgi_app
try:
ctx.push()
response = self.full_dispatch_request()
except Exception as e:
error = e
response = self.handle_exception(e)
except: # noqa: B001
error = sys.exc_info()[1]
raise
return response(environ, start_response)
finally:
File "/usr/local/python3/lib/python3.7/site-packages/flask/app.py", line2528, inwsgi_app
ctx = self.request_context(environ)
error: t.Optional[BaseException] = None
try:
try:
ctx.push()
response = self.full_dispatch_request()
except Exception as e:
error = e
response = self.handle_exception(e)
except: # noqa: B001
error = sys.exc_info()[1]
File "/usr/local/python3/lib/python3.7/site-packages/flask/app.py", line1825, infull_dispatch_request
request_started.send(self)
rv = self.preprocess_request()
if rv is None:
rv = self.dispatch_request()
except Exception as e:
rv = self.handle_user_exception(e)
return self.finalize_request(rv)
def finalize_request(
self,
rv: t.Union[ft.ResponseReturnValue, HTTPException],
File "/usr/local/python3/lib/python3.7/site-packages/flask/app.py", line1823, infull_dispatch_request
try:
request_started.send(self)
rv = self.preprocess_request()
if rv is None:
rv = self.dispatch_request()
except Exception as e:
rv = self.handle_user_exception(e)
return self.finalize_request(rv)
def finalize_request(
File "/usr/local/python3/lib/python3.7/site-packages/flask/app.py", line1799, indispatch_request
and req.method == "OPTIONS"
):
return self.make_default_options_response()
# otherwise dispatch to the handler for that endpoint
view_args: t.Dict[str, t.Any] = req.view_args # type: ignore[assignment]
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
def full_dispatch_request(self) -> Response:
"""Dispatches the request and on top of that performs request
pre and postprocessing as well as HTTP exception catching and
error handling.
File "/www/wwwroot/chat.py", line39, ingen_header
# post入参访问方式二:from-data(k-v)格式参数
@api.route('/gen_header', methods=['post'])
def gen_header():
wd = flask.request.values.get('wd')
future = executor.submit(do_heavy_work,wd)
return str(future.result())
def do_heavy_work(wd):
prompt = wd
#openai.api_key = api_key_list[-1]
openai.api_key = random.choice(api_key_list)
File "/usr/local/python3/lib/python3.7/concurrent/futures/_base.py", line435, inresult
self._condition.wait(timeout)
if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]:
raise CancelledError()
elif self._state == FINISHED:
return self.__get_result()
else:
raise TimeoutError()
def exception(self, timeout=None):
"""Return the exception raised by the call that the future represents.
File "/usr/local/python3/lib/python3.7/concurrent/futures/_base.py", line384, in__get_result
with self._condition:
return self._state in [CANCELLED, CANCELLED_AND_NOTIFIED, FINISHED]
def __get_result(self):
if self._exception:
raise self._exception
else:
return self._result
def add_done_callback(self, fn):
"""Attaches a callable that will be called when the future finishes.IndexError: Cannot choose from an empty sequence
This is the Copy/Paste friendly version of the traceback.
concurrent.futures.process._RemoteTraceback: """Traceback (most recent call last): File "/usr/local/python3/lib/python3.7/concurrent/futures/process.py", line 239, in _process_worker r = call_item.fn(*call_item.args, **call_item.kwargs) File "/www/wwwroot/chat.py", line 44, in do_heavy_work openai.api_key = random.choice(api_key_list) File "/usr/local/python3/lib/python3.7/random.py", line 261, in choice raise IndexError('Cannot choose from an empty sequence') from NoneIndexError: Cannot choose from an empty sequence"""The above exception was the direct cause of the following exception:Traceback (most recent call last): File "/usr/local/python3/lib/python3.7/site-packages/flask/app.py", line 2551, in __call__ return self.wsgi_app(environ, start_response) File "/usr/local/python3/lib/python3.7/site-packages/flask/app.py", line 2531, in wsgi_app response = self.handle_exception(e) File "/usr/local/python3/lib/python3.7/site-packages/flask/app.py", line 2528, in wsgi_app response = self.full_dispatch_request() File "/usr/local/python3/lib/python3.7/site-packages/flask/app.py", line 1825, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/local/python3/lib/python3.7/site-packages/flask/app.py", line 1823, in full_dispatch_request rv = self.dispatch_request() File "/usr/local/python3/lib/python3.7/site-packages/flask/app.py", line 1799, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) File "/www/wwwroot/chat.py", line 39, in gen_header return str(future.result()) File "/usr/local/python3/lib/python3.7/concurrent/futures/_base.py", line 435, in result return self.__get_result() File "/usr/local/python3/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result raise self._exceptionIndexError: Cannot choose from an empty sequenceThe debugger caught an exception in your WSGI application. You can now look at the traceback which led to the error. If you enable JavaScript you can also use additional features such as code execution (if the evalex feature is enabled), automatic pasting of the exceptions and much more.Brought to you byDON'T PANIC, your friendly Werkzeug powered traceback interpreter.Console Locked
The console is locked and needs to be unlocked by entering the PIN. You can find the PIN printed out on the standard output of your shell that runs the server.
PIN:
1、微信登录不上怎么办?
优质回答1:1.
打开微信,进入微信登录页面,页面底部选择更多选项点击打开。
2.
页面弹出窗口菜单栏,选择反馈问题这一选项点击打开。
3.
翻转进入问题反馈页面,页面选择登录、注册这一选项点击。
4.
页面翻转选择无法登录这一选项点击打开,翻转进入问题反馈页面。
5.
页面输入你的联系方式、问题描述、无法登录微信的问题截图。
6.
页面点击开启上传日志,点击提交,即可等待微信官方解决因微信系统原因导致的微信登录失败。
优质回答2:1.
检查网络,是否是由于没有网络导致登录不上。
2.
检查是否因为大小写的原因输入错了密码。
3.
检查微信账户有没有被冻结、封号等原因。
4.
重启一下手机,再打开微信。
5.
以上 *** 均不好使,就将微信卸载重新安装。
优质回答3:步骤/方式1
微信登录不上,一般是由于网络原因造成的,首先我们可以将家里的路由器拿出来
步骤/方式2
然后将路由器后面的电源线插拔一下
2、微信为什么登不上去?
优质回答1:微信登录不上可能有以下几点原因:
1、微信需要更新,可去手机应用商店查看详情,对微信进行更新;
2、网络故障,可能所使用的网络出现故障,建议查询无线网连接情况或者移动网络连接情况,更换好的网络环境再行尝试;
3、手机系统故障,可以清理下手机系统缓存,关机之后再试;
4、微信自身问题,检查微信最近是否有违规现象导致的封号,如被封号,建议申请解封;
5、微信被盗,可以尝试用注册时候的手机号码进行验证身份找回密码,找回之后进行登录,必要时可以发起账号申诉。
优质回答2:微信账号被封了,查看是否被封号了
3、不能用微信登录是为什么?
您好!很高兴能为您解答,一般有三种情况:
第一:如果你不是在原来注册微信号的手机上或者常使用这个微信帐号的手机上登录,会出现登录不了,现在微信带有设备识别功能,建议,不要再尝试登录,以免封号。
第二:常规登录障碍排除,由于重新登录发生不能登录的情况,按照登录的首页下方“其他方式登录”,然后用注册手机验证登录就可以。
4、为啥微信登不了了呢?
一般来说,如果微信登不了了,大部分人都出现过这种情况,总的来说,微信登不上的原因可能是信号不好,或者密码错误,也可能是被封或被盗了。
5、微信登录不上最快解决 *** ?
步骤/方式一
把登陆不上的微信卸载,之后在App Store重新安装就可以了。以苹果手机为例:
打开手机,长摁微信图标,出现✖️后,点击✖️
步骤/方式二
出现菜单后,点击删除,删除手机里的微信
步骤/方式三
在右下角找到App Store打开
步骤/方式四
进去页面,点击搜索,点击搜索栏
步骤/方式五
重新找到微信,点击右侧的云朵图标,下载完毕就会变为打开图标
步骤/方式六
输入账号密码即可登陆。
版权声明:免责声明:本文来源网友投稿及网络整合仅代表文章作者的个人观点,与本站无关。其原创性、真实性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容文字的真实性、完整性和原创性本站不作任何保证或承诺,请读者仅作参考,并自行核实相关内容。投诉邮箱:1765130767@qq.com.