推荐学习书目
› 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
chenguoyu
V2EX  ›  Python

为什么我用 pycharm 安装第三方库老是失败啊,也百度了很多,没找到啊

  •  
  •   chenguoyu · Nov 30, 2016 · 65170 views
    This topic created in 3626 days ago, the information mentioned may be changed or developed.

    pip install --index-url http://pypi.doubanio.com/simple/ requests

    Non-zero exit code (1)

    Try to run this command from the system terminal. Make sure that you use the correct version of 'pip' installed for your Python interpreter located at 'C:\Python\Python36\python.exe'.

    Collecting requests

    The repository located at pypi.doubanio.com is not a trusted or secure host and is being ignored. If this repository is available via HTTPS it is recommended to use HTTPS instead, otherwise you may silence this warning and allow it anyways with '--trusted-host pypi.doubanio.com'. Could not find a version that satisfies the requirement requests (from versions: ) No matching distribution found for requests

    26 replies  •  2016-12-01 09:02:25 +08:00
    chenguoyu
    chenguoyu
    OP
    Nov 30, 2016
    1
    把 http 改成 https 也没用啊
    gkiwi
    gkiwi
    Nov 30, 2016
    2
    pip install requests --trusted-host pypi.doubanio.com 试试
    neoblackcap
    neoblackcap
    Nov 30, 2016❤️2
    3
    换清华的源试试
    pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package
    q397064399
    q397064399
    Nov 30, 2016
    4
    Try to run this command from the system terminal. Make sure that you use the correct version of 'pip' installed for your Python interpreter located at 'C:\Python\Python36\python.exe'.

    好好把这段给鸡翻一下,你看是不是 pip 跟 python 版本不对应
    chenguoyu
    chenguoyu
    OP
    Nov 30, 2016
    5
    @neoblackcap
    @gkiwi
    Command "python setup.py egg_info" failed with error code 1 in C:\Users\cgy\AppData\Local\Temp\pip-build-wwuh4pnj\cffi\
    这是怎么回事呢?
    chenguoyu
    chenguoyu
    OP
    Nov 30, 2016
    6
    @q397064399 我 pip 的版本是最新的 9.01 ,应该不会吧
    lrh3321
    lrh3321
    Nov 30, 2016
    7
    windows 下安装库?

    你安装了 Microsoft Visual C++ Compiler for Python 2.7 或者 Microsoft Visual C++ Compiler for Python 3.4 了吗
    LeGendAI
    LeGendAI
    Nov 30, 2016
    9
    你是不是还装了 Python2.x 版,可能是用了 2.x 对应的 pip
    chenguoyu
    chenguoyu
    OP
    Nov 30, 2016
    10
    @lrh3321 为什么我百度不到安装包呢?能不能给个链接
    chenguoyu
    chenguoyu
    OP
    Nov 30, 2016
    11
    @LeGendAI 我已经卸载了,难道是没卸载干净?
    LeGendAI
    LeGendAI
    Nov 30, 2016
    12
    @chenguoyu 你可以 pip -V 看看是不是 3.x 的版本
    lrh3321
    lrh3321
    Nov 30, 2016
    13
    @chenguoyu https://www.microsoft.com/en-us/download/details.aspx?id=44266 2.7 的

    3.x 版本的话,我是直接装了 VS 2015. 你试试 Visual C++ Build Tools
    http://landinghub.visualstudio.com/visual-cpp-build-tools 有没有用吧
    chunk
    chunk
    Nov 30, 2016
    14
    最近 pypi 源抽风
    SlipStupig
    SlipStupig
    Nov 30, 2016
    15
    跟 VC 和 PIP 版本都没关系就是个参数问题, pip install --index-url http://pypi.doubanio.com/simple/ requests --trusted-host pypi.doubanio.com , 需要用这个参数“-trusted-host pypi.doubanio.com ”,否则为不信任源
    yunfengjiang
    yunfengjiang
    Nov 30, 2016
    16
    命令后加上--trusted-host pypi.doubanio.com 这个参数 pip install --index-url http://pypi.doubanio.com/simple/ requests --trusted-host pypi.doubanio.com
    chenguoyu
    chenguoyu
    OP
    Nov 30, 2016
    17
    @LeGendAI
    pip 9.0.1 from C:\Users\cgy\AppData\Roaming\Python\Python36\site-packages (python 3.6)
    没有问题呀
    chenguoyu
    chenguoyu
    OP
    Nov 30, 2016
    18
    Command "c:\python\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\cgy\\AppData\\Local\\Temp\\pip-build-clugysos\\numpy\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.rea
    d().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\cgy\AppData\Local\Temp\pip-_hf3fge5-record\install-record.txt --single-version-externally-managed --compile" fai
    led with error code 1 in C:\Users\cgy\AppData\Local\Temp\pip-build-clugysos\numpy\

    这是什么问题啊
    misaka19000
    misaka19000
    Nov 30, 2016
    19
    给了管理员权限了吗
    chenguoyu
    chenguoyu
    OP
    Nov 30, 2016
    20
    @misaka19000 给了,但是没用啊。而且一般是不用给管理员权限的吧
    chenguoyu
    chenguoyu
    OP
    Nov 30, 2016
    21
    现在换成清华的镜像是可以的,可是报了个新的错
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2
    好像是编译器的问题,但是还是无法解决
    xucuncicero
    xucuncicero
    Nov 30, 2016
    22
    @chenguoyu set STATICBUILD=true && pip install XXX
    billgreen1
    billgreen1
    Nov 30, 2016 via iPhone
    23
    Windows 上,编译会经常有问题。可以尝试使用 anaconda 或者,国外有个.edu 的网站,有已经编译好的
    ap010gi2e
    ap010gi2e
    Nov 30, 2016
    24
    一般这个时候我会检查我的 pip 版本是不是最新版。我一般出现是在初始化 virtualenv 的时候,那时候 pip 的版本不是最新的,可试试。
    mingyun
    mingyun
    Dec 1, 2016
    25
    python 在 windows 安装库很蛋疼
    8 楼比较靠谱,不过也不一定成功
    chenguoyu
    chenguoyu
    OP
    Dec 1, 2016
    26
    @ap010gi2e
    @mingyun
    是最新的啊,我现在报 vs2014 目录下的 cl.exe 找不到 msdia140.dll ,可是明明有啊
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1364 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 62ms · UTC 20:54 · PVG 04:54 · LAX 12:54 · JFK 15:54
    ♥ Do have faith in what you're doing.