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:
张雨绮目前应该是单身状态,她有两段婚姻,第一任丈夫是王安全,第二任丈夫袁巴元。
张雨绮跟王安全是在拍摄白鹿原是所相识,不久后就擦出爱情之火。但好景不长,因为各种原因选择了分手。
张雨绮跟袁巴元更是火速结婚,听说认识70天便领证,但婚姻维持了不久,也因家庭矛盾琐碎不断而选择离婚。
优质答案2:
张雨绮已经离婚了,现在没有老公。
张雨绮原名张爽,出生于山东德州,毕业于上海戏剧学院附属戏曲学校,华语电影女演员。2002年签约星辉公司,成为星女郎。2006年主演《长江七号》正式出道。2008年出演《女人不坏》被大众熟知,凭借该电影入围第28届香港电影金像奖最佳新人奖。
优质答案3:
袁巴元,男,1973年11月出生,复旦大学博士。现任中国上海笕尚实业股份有限公司董事长及总经理。与前妻葛晓倩育有一女,但并未领证。2016年10月26日,张雨绮工作微博晒出结婚证照片,公布张雨绮与袁巴元结婚。2018年9月27日,张雨绮、袁巴元协议离婚。
二、张雨绮是什么星座?
狮子座。
张雨绮,原名张爽,1987年8月8日出生于山东省德州市[1][2],中国内地影视女演员,毕业于上海戏剧学院附属戏曲学校2004级。
2006年,在周星驰电影《长江7号》中出演女主角袁老师
三、张雨绮和张柏芝是什么关系?
张雨绮和张柏芝是没关系。一个是中国内地演员,一个是中国香港演员。张雨绮,原名张爽,1987年8月8日出生于山东省德州市,中国内地影视女演员,毕业于上海戏剧学院附属戏曲学校2004级。张柏芝,1980年5月24日出生于中国香港,中国香港影视女演员、歌手。1998年出演个人首部电影《喜剧之王》。
四、张雨绮自曝身高?
优质答案1:
资料显示身高:166cm。
张雨绮,女,原名张爽,1987年8月8日出生于中国山东省德州市,毕业于上海戏剧学院附属戏曲学校,中国内地女演员。
2002年签约星辉公司,成为星女郎。2006年主演《长江七号》正式出道。2008年凭借电影《女人不坏》获得第28届香港电影金像奖最佳新演员提名。2010年凭借电影《白鹿原》获得第20届北京大学生电影节最受大学生欢迎的女演员奖。2013年凭借《白鹿原》《钱学森》两部作品获得第14届中国电影表演艺术学会奖。2016年主演的电影《美人鱼》上映;次年凭借该片获得第36届香港电影金像奖最佳女配角提名。
优质答案2:
张雨绮大家都知道可谓是个直性子,敢说敢做,看其和两任老公离婚时的态度就知道了,张雨绮说自己一米六五,王宝强说自己也是一米六五,张雨绮不服气说自己才是一米六五,你明明比我矮一公分,一米 *** ,这么耿直的性子也是没谁了。网友说你当我们瞎啊,确实比张雨绮低啊。
优质答案3:
张雨绮长了一张170cm+的脸,但实际身高在163cm左右。和官方报的166cm,差的有点多···
五、张雨绮首部作品?
优质答案1:
首部作品是《长江七号》。
2006年,张雨绮首部作品是周星驰自导自演的科幻喜剧电影《长江七号》,饰演周铁的爱人袁老师。
张雨绮,原名张爽,1987年8月8日出生于山东省德州市,中国内地女演员,毕业于上海戏剧学院附属戏曲学校2004级。
代表作品有《妖猫传》《美人鱼》《白鹿原》《钱学森》《长江七号》《龙岭迷窟《云南虫谷》等。
优质答案2:
张雨绮的首部作品是周星驰的电影长江七号
优质答案3:
2010年,张雨绮第一部真正主演的电影《刀见笑》。这部电影导演当时24k纯新人,是当时张雨绮男朋友汪小菲赞助的
版权声明:免责声明:本文来源网友投稿及网络整合仅代表文章作者的个人观点,与本站无关。其原创性、真实性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容文字的真实性、完整性和原创性本站不作任何保证或承诺,请读者仅作参考,并自行核实相关内容。投诉邮箱:1765130767@qq.com.