我无法导入aiohttp,但它似乎已经安装好了

2024-09-28 17:15:11 发布

您现在位置:Python中文网/ 问答频道 /正文

我无法导入aiohttp,但它似乎已安装。当我尝试导入它时,我得到以下错误。在

我试图卸载aiohttp,并多次重新安装它。在

我的代码:

import aiohttp

错误:

^{pr2}$

安装aiohttp

$ pip install aiohttp -t /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/

Collecting aiohttp
  Using cached https://files.pythonhosted.org/packages/16/60/c6ac986c2caeab6d3bae1e0b3400ab49df3aff23a8e37c543be68780d014/aiohttp-3.5.4-cp37-cp37m-macosx_10_13_x86_64.whl
Collecting yarl<2.0,>=1.0 (from aiohttp)
Collecting multidict<5.0,>=4.0 (from aiohttp)
  Using cached https://files.pythonhosted.org/packages/0e/64/39b167d63e292cc2336d09c4d3577089db82cd7886ed535b6100fc7c7966/multidict-4.5.2-cp37-cp37m-macosx_10_12_intel.macosx_10_12_x86_64.macosx_10_13_intel.macosx_10_13_x86_64.whl
Collecting attrs>=17.3.0 (from aiohttp)
  Using cached https://files.pythonhosted.org/packages/3a/e1/5f9023cc983f1a628a8c2fd051ad19e76ff7b142a0faf329336f9a62a514/attrs-18.2.0-py2.py3-none-any.whl
Collecting async-timeout<4.0,>=3.0 (from aiohttp)
  Using cached https://files.pythonhosted.org/packages/e1/1e/5a4441be21b0726c4464f3f23c8b19628372f606755a9d2e46c187e65ec4/async_timeout-3.0.1-py3-none-any.whl
Collecting chardet<4.0,>=2.0 (from aiohttp)
  Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl
Collecting idna>=2.0 (from yarl<2.0,>=1.0->aiohttp)
  Using cached https://files.pythonhosted.org/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl
Installing collected packages: idna, multidict, yarl, attrs, async-timeout, chardet, aiohttp
Successfully installed aiohttp-3.5.4 async-timeout-3.0.1 attrs-18.2.0 chardet-3.0.4 idna-2.8 multidict-4.5.2 yarl-1.3.0

Tags: fromhttpsorgaiohttppackagesfilesattrsmacosx