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:
这是工信部批准的虚拟运营商发行的虚拟手机号,因为这些虚拟运营商没有自己的网络,是通过租用移动,联通,电信三家网络来实现通话,发短信,上网的,所以他们叫虚拟运营商。
工信部把160到167,170到177之间的号码段给他们,专门用来发行虚拟号码用的
优质答案2:
回答:一般是通过第三方APP软件自动组合成一组临时手机号码使用,目的是保护信息发布者的个人隐私安全!
个人观点,仅供参考!
优质答案3:
手机号虚拟号用于想保护隐私而不想给出真实号码的情况,比如房屋买卖、交友、网购、装修、打车等等容易产生骚扰的情况.也可以用于一些网站注册!
二、电信虚拟号是什么意思?
电信虚拟号是一种新型的通信服务,主要是为客户提供一个在没有实际物理连接的情况下,仍然能够使用的虚拟号码。
电信虚拟号的号码不同于传统的 *** 号码,不存在固定的位置,而是在网络上模拟出来的号码,即使搬家也不会变更号码。
电信虚拟号的用户可以很方便地改变号码,只要注册就可以使用,不需要到电信营业厅办理,这样就可以省去很多时间和金钱。此外,电信虚拟号还可以提供其他服务,比如虚拟号码、短信等服务。
三、虚拟 *** 是什么意思?
优质答案1:
虚拟号码指不是通讯公司发布的的 *** 号码,多是比常规 *** 号码过长或过短的号码序列,却具有可以接听,拨打 *** 的普通 *** 号码功能。常用于skype等提供网络 *** 服务的平台。就不是真正的 *** 号码,然后又具有普通 *** 号码的功能,可以接听 *** 等。
比方虚拟号,多数是软件号码,怎么讲,就是登陆一个软件后,该软件就好比一个 *** 机,用来接听 *** 用,说白了就是把电脑当 *** 机用了,
优质答案2:
就是你设定好时间,然后在时间到了之后,手机会出现像别人给你打 *** 一样的界面以及 *** 。
四、虚拟号码和正常号码的区别?
优质答案1:
区别:虚拟号不需要申请手机卡即可使用,正常号需要安装SIM卡才能使用;虚拟号由虚拟运营商提供,正常号由三大运营商提供;虚拟号是随机生成的,可以保护隐私,正常号是固定的,对方知道手机号即可联系。
1、用不用手机卡。虚拟号段不需要手机卡就能使用,正常号段必须安装SIM卡才能正常使用。
2、号码生成方式。虚拟号段随机生成,能有效保护隐私,正常号段是固定的,必须知道手机号码才能互相联系。
3、三大运营商的虚拟号段如下:中国电信:1700、1701、1702。中国移动:1703、1705、1706。中国联通:1704、1707、1708、1709,1710、1711、1712、1713、1714、1715、1716、1717、1718、1719。
优质答案2:
虚拟号码是通过网络拨打的,所以可以被认为是语音聊天而正常的号码是通过基站的转接而连接的,所以我们在使用正常号码的时候是不可以使用数据网的也是原因之一,而虚拟号码是必须要使用数据网或者无线网才可以拨通的,这就是区别。
优质答案3:
虚拟号段就是虚拟运营商号码,而虚拟运营商就像是代理商,正常号段,SIM卡为用户身份识别卡、智能卡,GSM数字移动 *** 机必须装上此卡方能使用。
在电脑芯片上存储了数字移动 *** 客户的信息,加密的密钥以及用户的 *** 簿等内容,可供GSM网络客户身份进行鉴别,并对客户通话时的语音信息进行加密。
五、虚拟手机号什么意思?
优质答案1:
虚拟手机号码是指手机虚拟运营商的号码。这些号码只能通过电脑向客户呼出。在电脑上聊天。SIP协议转换的语音通过网络到达pstn,到达客户的手机。虚拟手机号不需要员工办卡。它会根据需要的座位数申请运营商的家号,处理后就可以使用了。虚拟手机号是在系统中依次换号拨打的,客户对外显示的也是拨打的号码。如果客户打不通这个外显号,这种号其实是正常号。
优质答案2:
第三方平台的通讯,保障客服隐私
版权声明:免责声明:本文来源网友投稿及网络整合仅代表文章作者的个人观点,与本站无关。其原创性、真实性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容文字的真实性、完整性和原创性本站不作任何保证或承诺,请读者仅作参考,并自行核实相关内容。投诉邮箱:1765130767@qq.com.