V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
bob1994
V2EX  ›  Python

小白提问 Python 问题, macos 系统

  •  
  •   bob1994 · 2018-07-09 16:58:20 +08:00 · 2550 次点击
    这是一个创建于 2336 天前的主题,其中的信息可能已经有所发展或是发生改变。

    pip3 最近安装库都有问题,

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

    如下载 aiohttp:

    11 条回复    2018-07-10 09:25:40 +08:00
    bob1994
        1
    bob1994  
    OP
       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
        2
    bob1994  
    OP
       2018-07-09 16:59:14 +08:00
    好像 最后少了 Successfully installed 那句话啊,求解。
    TOUJOURSER
        3
    TOUJOURSER  
       2018-07-09 17:21:42 +08:00
    在环境中试下 import aiohttp 是否成功
    bob1994
        4
    bob1994  
    OP
       2018-07-09 17:39:19 +08:00
    @TOUJOURSER 不行诶,就提示找不到该库。
    TOUJOURSER
        5
    TOUJOURSER  
       2018-07-09 17:59:40 +08:00
    @bob1994
    或者手动下载 aiohttp

    python 3.5 去执行 setup.py 安装。
    bob1994
        6
    bob1994  
    OP
       2018-07-09 18:04:27 +08:00
    @TOUJOURSER 刚刚试着下了其他的模块,都是差不多情况,只能下载,不会安装。。
    bob1994
        7
    bob1994  
    OP
       2018-07-09 18:05:04 +08:00
    @TOUJOURSER 我感觉要重新安装 pip3 了 /摊手
    TOUJOURSER
        8
    TOUJOURSER  
       2018-07-09 18:06:42 +08:00
    @bob1994 没用过 mac 我在 linux 没遇到过这种问题
    VVVVVEX
        9
    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
        10
    bob1994  
    OP
       2018-07-09 18:20:40 +08:00   ❤️ 1
    好了,在 pip3 install XXX 后面追加 --user 就行了
    估计是哪个文件夹权限出了点问题吧,回头给看看
    此贴总结,谢谢诸位。
    vZexc0m
        11
    vZexc0m  
       2018-07-10 09:25:40 +08:00
    应该是权限问题,试试虚拟环境吧
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2700 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 07:28 · PVG 15:28 · LAX 23:28 · JFK 02:28
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.