小白提问 Python 问题, macos 系统

2018-07-09 16:58:20 +08:00
 bob1994

pip3 最近安装库都有问题,

能正常下载但好像不能正常安装,pip3 list 里面也没有显示,

如下载 aiohttp:

2573 次点击
所在节点    Python
11 条回复
bob1994
2018-07-09 16:58:41 +08:00
MacBook-Pro:~ nixiabing$ pip3 install aiohttp -U
Collecting aiohttp
Using cached https://files.pythonhosted.org/packages/7b/58/1d258b6853a3ba9b6627933f53f307958932701ffb2318f89d0d077a1de1/aiohttp-3.3.2-cp36-cp36m-macosx_10_12_x86_64.whl
Collecting async-timeout<4.0,>=3.0 (from aiohttp)
Using cached https://files.pythonhosted.org/packages/96/0f/e6357458c87fb4ed8f3df215773f3caad40968f10e05552cbd8bd28415e4/async_timeout-3.0.0-py3-none-any.whl
Collecting idna-ssl>=1.0 (from aiohttp)
Collecting multidict<5.0,>=4.0 (from aiohttp)
Collecting yarl<2.0,>=1.0 (from aiohttp)
Requirement not upgraded as not directly required: chardet<4.0,>=2.0 in /usr/local/lib/python3.6/site-packages (from aiohttp) (3.0.4)
Requirement not upgraded as not directly required: attrs>=17.3.0 in /usr/local/lib/python3.6/site-packages (from aiohttp) (17.3.0)
Requirement not upgraded as not directly required: idna>=2.0 in /usr/local/lib/python3.6/site-packages (from idna-ssl>=1.0->aiohttp) (2.6)
Installing collected packages: async-timeout, idna-ssl, multidict, yarl, aiohttp
bob1994
2018-07-09 16:59:14 +08:00
好像 最后少了 Successfully installed 那句话啊,求解。
TOUJOURSER
2018-07-09 17:21:42 +08:00
在环境中试下 import aiohttp 是否成功
bob1994
2018-07-09 17:39:19 +08:00
@TOUJOURSER 不行诶,就提示找不到该库。
TOUJOURSER
2018-07-09 17:59:40 +08:00
@bob1994
或者手动下载 aiohttp

python 3.5 去执行 setup.py 安装。
bob1994
2018-07-09 18:04:27 +08:00
@TOUJOURSER 刚刚试着下了其他的模块,都是差不多情况,只能下载,不会安装。。
bob1994
2018-07-09 18:05:04 +08:00
@TOUJOURSER 我感觉要重新安装 pip3 了 /摊手
TOUJOURSER
2018-07-09 18:06:42 +08:00
@bob1994 没用过 mac 我在 linux 没遇到过这种问题
VVVVVEX
2018-07-09 18:18:59 +08:00
pip3 install aiohttp
Collecting aiohttp
Downloading https://files.pythonhosted.org/packages/72/6a/5bbf3544fe8de525f4521506b372dc9c3b13070fe34e911c976aa95631d7/aiohttp-3.3.2.tar.gz (771kB)
100% |████████████████████████████████| 778kB 401kB/s
Installing build dependencies ... done
Collecting attrs>=17.3.0 (from aiohttp)
Using cached https://files.pythonhosted.org/packages/41/59/cedf87e91ed541be7957c501a92102f9cc6363c623a7666d69d51c78ac5b/attrs-18.1.0-py2.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 multidict<5.0,>=4.0 (from aiohttp)
Downloading https://files.pythonhosted.org/packages/9d/b9/3cf1b908d7af6530209a7a16d71ab2734a736c3cdf0657e3a06d0209811e/multidict-4.3.1.tar.gz (137kB)
100% |████████████████████████████████| 143kB 386kB/s
Collecting async_timeout<4.0,>=3.0 (from aiohttp)
Downloading https://files.pythonhosted.org/packages/96/0f/e6357458c87fb4ed8f3df215773f3caad40968f10e05552cbd8bd28415e4/async_timeout-3.0.0-py3-none-any.whl
Collecting yarl<2.0,>=1.0 (from aiohttp)
Downloading https://files.pythonhosted.org/packages/43/b8/057c3e5b546ff4b24263164ecda13f6962d85c9dc477fcc0bcdcb3adb658/yarl-1.2.6.tar.gz (159kB)
100% |████████████████████████████████| 163kB 193kB/s
Collecting idna>=2.0 (from yarl<2.0,>=1.0->aiohttp)
Using cached https://files.pythonhosted.org/packages/4b/2a/0276479a4b3caeb8a8c1af2f8e4355746a97fab05a372e4a2c6a6b876165/idna-2.7-py2.py3-none-any.whl
Building wheels for collected packages: aiohttp, multidict, yarl
Running setup.py bdist_wheel for aiohttp ... done
Stored in directory: /Users/user/Library/Caches/pip/wheels/59/97/52/82949a34823dbc5ea2e318d6656ffd3e1bd6aa54e955b9ec15
Running setup.py bdist_wheel for multidict ... done
Stored in directory: /Users/user/Library/Caches/pip/wheels/97/06/92/091e8e6546ccaa08c78527058a6662e8bf5e0db9aeff0392bb
Running setup.py bdist_wheel for yarl ... done
Stored in directory: /Users/user/Library/Caches/pip/wheels/fd/1c/e7/9df9bfc03a2f55c2201b52db3545b1314eb807148563a6521b
Successfully built aiohttp multidict yarl
Installing collected packages: attrs, chardet, multidict, async-timeout, idna, yarl, aiohttp
Successfully installed aiohttp-3.3.2 async-timeout-3.0.0 attrs-18.1.0 chardet-3.0.4 idna-2.7 multidict-4.3.1 yarl-1.2.6
bob1994
2018-07-09 18:20:40 +08:00
好了,在 pip3 install XXX 后面追加 --user 就行了
估计是哪个文件夹权限出了点问题吧,回头给看看
此贴总结,谢谢诸位。
vZexc0m
2018-07-10 09:25:40 +08:00
应该是权限问题,试试虚拟环境吧

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/469327

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX