美文网首页
pip的一些记录

pip的一些记录

作者: andrew_su_cd | 来源:发表于2020-04-02 21:38 被阅读0次

    在windows中有linux子系统之后,将python在子系统中使用,变成非常的爽。

    1、pip配置文件
    在 $home中创建.pip目录
    然后创建 pip.conf

    2、配置pypi的国内源
    pip install -i https://pypi.douban.com/simple
    但是更加方便的是在pip.conf中配置
    [global]
    index-url = https://pypi.douban.com/simple/
    no-cache-dir = True
    [install]
    trusted-host = https://pypi.douban.com/simple/

    3、配置cache目录或者不配置cache
    使用pip --help可以看到如下两个参数
    --cache-dir
    --no-cache-dir
    可以在pip.conf中的global中配置
    缺省的在.cache/pip中,安装一个tensorflow之后,会占到将近1G,让你不知不觉中让系统盘增加非常迅速。
    no-cache-dir =True 表示不需要cache
    cache-dir = /mnt/e/.cache/pip 表示需要在/mnt/e/.cahce/pip中存放cache

    相关文章

      网友评论

          本文标题:pip的一些记录

          本文链接:https://www.haomeiwen.com/subject/gagfphtx.html