这是我在macOS上运行python flask应用程序时遇到的错误。我怎样才能解决它
Traceback (most recent call last):
File "/Users/truongnguyen/Library/Python/3.6/lib/python/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/Users/truongnguyen/Library/Python/3.6/lib/python/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/Users/truongnguyen/Library/Python/3.6/lib/python/site-packages/flask_cors/extension.py", line 165, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "/Users/truongnguyen/Library/Python/3.6/lib/python/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/Users/truongnguyen/Library/Python/3.6/lib/python/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/Users/truongnguyen/Library/Python/3.6/lib/python/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/Users/truongnguyen/Library/Python/3.6/lib/python/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/Users/truongnguyen/Library/Python/3.6/lib/python/site-packages/connexion/decorators/decorator.py", line 48, in wrapper
response = function(request)
File "/Users/truongnguyen/Library/Python/3.6/lib/python/site-packages/connexion/decorators/uri_parsing.py", line 144, in wrapper
response = function(request)
File "/Users/truongnguyen/Library/Python/3.6/lib/python/site-packages/connexion/decorators/validation.py", line 184, in wrapper
response = function(request)
File "/Users/truongnguyen/Library/Python/3.6/lib/python/site-packages/connexion/decorators/parameter.py", line 121, in wrapper
return function(**kwargs)
File "/Users/truongnguyen/vRoute_Algo/server/server.py", line 159, in algo_handler
result = json.loads(results[process_key])
File "<string>", line 2, in __getitem__
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/managers.py", line 772, in _callmethod
raise convert_to_error(kind, result)
KeyError: '5c04fa020bfc60873bc7d34b-5c04fa020bfc60873bc7d34b'
该行:
正在从字符串创建dict并查找键
process_key
该键不在dict中,因此引发KeyError
查看第159行的代码,了解如何避免该问题
相关问题 更多 >
编程相关推荐