gpt4 book ai didi

python-3.x - 模块未找到错误: No module named 'aiohttp'

转载 作者:行者123 更新时间:2023-12-03 03:48:13 35 4
gpt4 key购买 nike

正在寻找 this existing issue 的解决方法

使用 azure web app(linux) 计划,linux_fx_version 为 Python|3.7

我的requirement.txt是

botbuilder_schema==4.13.0
requests==2.25.0
aiohttp==3.7.4
botbuilder==0.0.1
botbuilder-core==4.13.0
botbuilder-dialogs==4.13.0

当我尝试进行 zip 部署(az webapp deployment source config-zip )时,部署进展顺利 - Kudo zip deploy ,除非启动我的应用程序时它给出错误 liks module not find aiohttp

错误日志:

2021-06-28T07:35:59.154876250Z Build Operation ID: 58418482-e3f1-4f4f-8f3f-23c89fdc7228
2021-06-28T07:36:00.652990532Z Oryx Version: 0.2.20210420.1, Commit: 85c6e9278aae3980b86cb1d520aaad532c814ed7, ReleaseTagName: 20210420.1
2021-06-28T07:36:01.268742028Z Detected an app based on Flask
2021-06-28T07:36:01.270392332Z Generating `gunicorn` command for 'app:app'
2021-06-28T07:36:01.451069287Z Writing output script to '/opt/startup/startup.sh'
2021-06-28T07:36:01.897311466Z WARNING: Could not find virtual environment directory /home/site/wwwroot/antenv.
2021-06-28T07:36:01.897342966Z WARNING: Could not find package directory /home/site/wwwroot/__oryx_packages__.
2021-06-28T07:36:02.714252775Z [2021-06-28 07:36:02 +0000] [35] [INFO] Starting gunicorn 20.1.0
2021-06-28T07:36:02.715401977Z [2021-06-28 07:36:02 +0000] [35] [INFO] Listening at: http://0.0.0.0:8000 (35)
2021-06-28T07:36:02.715816178Z [2021-06-28 07:36:02 +0000] [35] [INFO] Using worker: sync
2021-06-28T07:36:02.725130896Z [2021-06-28 07:36:02 +0000] [38] [INFO] Booting worker with pid: 38
2021-06-28T07:36:02.757363360Z [2021-06-28 07:36:02 +0000] [38] [ERROR] Exception in worker process
2021-06-28T07:36:02.757382760Z Traceback (most recent call last):
2021-06-28T07:36:02.757439960Z File "/opt/python/3.7.9/lib/python3.7/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker
2021-06-28T07:36:02.757446560Z worker.init_process()
2021-06-28T07:36:02.757450260Z File "/opt/python/3.7.9/lib/python3.7/site-packages/gunicorn/workers/base.py", line 134, in init_process
2021-06-28T07:36:02.757463360Z self.load_wsgi()
2021-06-28T07:36:02.757467260Z File "/opt/python/3.7.9/lib/python3.7/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
2021-06-28T07:36:02.757470560Z self.wsgi = self.app.wsgi()
2021-06-28T07:36:02.757473760Z File "/opt/python/3.7.9/lib/python3.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
2021-06-28T07:36:02.757477360Z self.callable = self.load()
2021-06-28T07:36:02.757480460Z File "/opt/python/3.7.9/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
2021-06-28T07:36:02.757483660Z return self.load_wsgiapp()
2021-06-28T07:36:02.757486760Z File "/opt/python/3.7.9/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
2021-06-28T07:36:02.757489960Z return util.import_app(self.app_uri)
2021-06-28T07:36:02.757493160Z File "/opt/python/3.7.9/lib/python3.7/site-packages/gunicorn/util.py", line 359, in import_app
2021-06-28T07:36:02.845882934Z mod = importlib.import_module(module)
2021-06-28T07:36:02.845888734Z File "/opt/python/3.7.9/lib/python3.7/importlib/__init__.py", line 127, in import_module
2021-06-28T07:36:02.845892434Z return _bootstrap._gcd_import(name[level:], package, level)
2021-06-28T07:36:02.845895934Z File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
2021-06-28T07:36:02.845899934Z File "<frozen importlib._bootstrap>", line 983, in _find_and_load
2021-06-28T07:36:02.845903534Z File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
2021-06-28T07:36:02.845906934Z File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
2021-06-28T07:36:02.845910134Z File "<frozen importlib._bootstrap_external>", line 728, in exec_module
2021-06-28T07:36:02.845913434Z File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
2021-06-28T07:36:02.845924834Z File "/home/site/wwwroot/app.py", line 5, in <module>
2021-06-28T07:36:02.845929234Z from aiohttp import web
2021-06-28T07:36:02.845932334Z ModuleNotFoundError: No module named 'aiohttp'
2021-06-28T07:36:02.845936534Z [2021-06-28 07:36:02 +0000] [38] [INFO] Worker exiting (pid: 38)
2021-06-28T07:36:02.866740775Z [2021-06-28 07:36:02 +0000] [35] [INFO] Shutting down: Master
2021-06-28T07:36:02.867504676Z [2021-06-28 07:36:02 +0000] [35] [INFO] Reason: Worker failed to boot.

我尝试了不同版本的aiohttprequest,甚至增加了Python 3.8,到目前为止没有任何效果。

最佳答案

您可能正在使用 pip 而不是 pip3。尝试使用 pip3 install -rrequirements.txt 安装您的依赖项。

另一件事需要注意的是,如果您使用虚拟环境,则还需要在其中安装依赖项。

关于python-3.x - 模块未找到错误: No module named 'aiohttp' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68160988/

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