gpt4 book ai didi

python-3.x - 导入错误 : cannot import name 'bytes_type' in flask_oauthlib

转载 作者:行者123 更新时间:2023-12-05 03:02:40 25 4
gpt4 key购买 nike

我尝试使用 flask_oauthlib 构建应用程序并将其部署到 heroku,但我遇到了一些错误

2019-02-10T03:14:55.112096+00:00 app[web.1]:   File "/app/flask_oauthlib/client.py", line 20, in <module>
2019-02-10T03:14:55.112098+00:00 app[web.1]: from .utils import to_bytes
2019-02-10T03:14:55.112099+00:00 app[web.1]: File "/app/flask_oauthlib/utils.py", line 5, in <module>
2019-02-10T03:14:55.112102+00:00 app[web.1]: from oauthlib.common import to_unicode, bytes_type
2019-02-10T03:14:55.112106+00:00 app[web.1]: ImportError: cannot import name 'bytes_type'
2019-02-10T03:14:55.112616+00:00 app[web.1]: [2019-02-10 03:14:55 +0000] [11] [INFO] Worker exiting (pid: 11)
2019-02-10T03:14:55.112784+00:00 app[web.1]: [2019-02-10 03:14:55 +0000] [10] [INFO] Worker exiting (pid: 10)
2019-02-10T03:14:55.267604+00:00 app[web.1]: [2019-02-10 03:14:55 +0000] [4] [INFO] Shutting down: Master
2019-02-10T03:14:55.267763+00:00 app[web.1]: [2019-02-10 03:14:55 +0000] [4] [INFO] Reason: Worker failed to boot.
2019-02-10T03:17:31.597353+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=askfess.herokuapp.com request_id=1e14f0da-5bbe-4849-9308-3ecf8a49306f fwd="140.213.38.39" dyno= connect= service= status=503 bytes= protocol=https

有什么办法可以解决吗?仅当我尝试在 heroku 中部署时出现应用程序错误,但在本地主机中运行良好

最佳答案

运行 pip 安装 requests-oauthlib:

pip install requests-oauthlib==1.1.0 

为我解决了这个问题!!

关于python-3.x - 导入错误 : cannot import name 'bytes_type' in flask_oauthlib,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54613168/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com