pipenv install django超级慢,卡住不动,最后不得不CTRL+C中止

这时有必要改成国内源了,打开Pipfile文件,发现内容是:

[[source]]
verify_ssl = true
name = "pypi"
url = "https://pypi.org/simple"

[packages]

[dev-packages]

[requires]
python_version = "3.4"

把url替换成阿里云源(这里国内源的选择问题可以参考我上篇文章:《pip使用国内镜像解决安装超时》):http://mirrors.aliyun.com/pypi/simple/

运行发现有出现不信任的问题了

索性将url改成url = "http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com"

[[source]]
verify_ssl = true
name = "pypi"
url = "http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com"

[packages]

[dev-packages]

[requires]
python_version = "3.4"

再次安装,显示:

这个问题是由于django需要python版本大于等于3.5,我的是3.4.4,版本不匹配导致,换requests库试试:pipenv install requests

可以看到,只花了3s,速度感人,有人说,清华源更好用,豆瓣源不好用,还没尝试

需要注意的是,这时候Profile文件中的[packages]下,多了requests = "*",标识了本项目依赖于requests

[[source]]
verify_ssl = true
name = "pypi"
url = "http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com"

[packages]
requests = "*"

[dev-packages]

[requires]
python_version = "3.4"

同时安装过程中有句话叫做 Updated Pipfile.lock,这时我们可以发现项目路径下又生成了一个 Pipfile.lock 文件,内容如下:

{
    "_meta": {
        "hash": {
            "sha256": "2520a3c6b3ead035956ec3f7f1a9ebeb0c274f4e1568f752dcfd4d6538193c52"
        },
        "pipfile-spec": 6,
        "requires": {
            "python_version": "3.4"
        },
        "sources": [
            {
                "name": "pypi",
                "url": "http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com",
                "verify_ssl": true
            }
        ]
    },
    "default": {
        "certifi": {
            "hashes": [
                "sha256:376690d6f16d32f9d1fe8932551d80b23e9d393a8578c5633a2ed39a64861638",
                "sha256:456048c7e371c089d0a77a5212fb37a2c2dce1e24146e3b7e0261736aaeaa22a"
            ],
            "version": "==2018.8.24"
        },
        "chardet": {
            "hashes": [
                "sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae",
                "sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691"
            ],
            "version": "==3.0.4"
        },
        "idna": {
            "hashes": [
                "sha256:156a6814fb5ac1fc6850fb002e0852d56c0c8d2531923a51032d1b70760e186e",
                "sha256:684a38a6f903c1d71d6d5fac066b58d7768af4de2b832e426ec79c30daa94a16"
            ],
            "version": "==2.7"
        },
        "requests": {
            "hashes": [
                "sha256:63b52e3c866428a224f97cab011de738c36aec0185aa91cfacd418b5d58911d1",
                "sha256:ec22d826a36ed72a7358ff3fe56cbd4ba69dd7a6718ffd450ff0e9df7a47ce6a"
            ],
            "index": "pypi",
            "version": "==2.19.1"
        },
        "urllib3": {
            "hashes": [
                "sha256:a68ac5e15e76e7e5dd2b8f94007233e01effe3e50e8daddf69acfd81cb686baf",
                "sha256:b5725a0bd4ba422ab0e66e89e030c806576753ea3ee08554382c14e685d117b5"
            ],
            "markers": "python_version != '3.2.*' and python_version < '4' and python_version != '3.1.*' and python_version != '3.3.*' and python_version != '3.0.*' and python_version >= '2.6'",
            "version": "==1.23"
        }
    },
    "develop": {}
}

可以看到里面标识了 Python 环境基本信息,以及依赖包的版本及 hashes 值

参考文章

https://blog.csdn.net/jpch89/article/details/81952416

https://cuiqingcai.com/5846.html

pipenv安装库使用国内镜像的更多相关文章

  1. Python pip安装第三方库的国内镜像

    Windows系统下,一般情况下使用pip在DOS界面安装python第三方库时,经常会遇到超时的问题,导致第三方库无法顺利安装,此时就需要国内镜像源的帮助了. 使用方法如下: 例如:pip inst ...

  2. Python中使用pip安装库时指定镜像源为豆瓣镜像源

    场景 在使用pip进行安装库时,使用默认的库会很慢,甚至有时会出现远程主机中断了一个现有连接. 怎样在使用pip install 时指定镜像源为豆瓣镜像源. 实现 pip install moviep ...

  3. Docker容器手动安装mysql(国内镜像)

    Docker手动安装mysql 1.创建centos镜像的容器 [root@localhost Tools]# docker run -i -d -h zabbix --name zabbix -p ...

  4. pip安装模块使用国内镜像源加速安装

    今天在安装Python模块matplotlib的时候,一直安装不成功,老是提示“socket.timeout: The read operation timed out”或者“Read timed o ...

  5. pip安装超时,更换国内镜像源安装

    pip安装超时问题 pip install --index 源地址 安装包 常用镜像源地址: http://pypi.douban.com/ 豆瓣 http://pypi.mirrors.ustc.e ...

  6. Composer的安装以及替换为国内镜像

    Composer的安装以及使用国内镜像 Composer 学习网址 Composer官网 https://getcomposer.org/ Composer中文网 http://www.phpcomp ...

  7. 使用anaconda安装pytorch的清华镜像地址

    1.安装anaconda:国内镜像网址:https://mirror.tuna.tsinghua.edu.cn/help/anaconda/下载对应系统对应python版本的anaconda版本(Li ...

  8. pip安装库时报错,使用国内镜像加速

    pip install requests或pip --trusted-host pypi.python.org install requests报错: 原因:网上解释为网速太慢,或被防火墙 解决方法: ...

  9. python pip 安装常用库如何使用国内镜像源

    最近通过python安装一些常用库发现下载速度特别慢,而且还会出现无法安装等错误,尝试找了一些国内的镜像源,发现阿里云的速度很快,这里做个记录,并分享给大家. 国内镜像源 阿里云:http://mir ...

随机推荐

  1. 剑指Offer——旋转数组的最小数字

    题目描述: 把一个数组最开始的若干个元素搬到数组的末尾,我们称之为数组的旋转. 输入一个非递减排序的数组的一个旋转,输出旋转数组的最小元素. 例如数组{3,4,5,1,2}为{1,2,3,4,5}的一 ...

  2. 解决:function in namespace ‘std’ does not name a type + allocator_/nullptr/dellocator_ was not declared + base operand of ‘->’ has non-pointer type ‘std::vector<cv::Mat>’ 错误编译时报错(caffe)

    解决方法,用到了c++11,g++命令需要加上-std=c++11选项 附:g++默认的c++标准 gcc-6.4.0 gcc-7.2.0 默认是 -std=gnu++14gcc-4.3.6 gcc- ...

  3. SQL 2005 分页存储过程

    -- ============================================= -- Description:   <高效分页存储过程,适用于Sql2005以上> -- ...

  4. windows 键盘全局钩子

    // HookapiTest.cpp : 定义控制台应用程序的入口点. // #include "stdafx.h" #include <Windows.h> #inc ...

  5. win64系统丢失d3dx9d_40.dll问题

    在Win64系统中,安装了DXSDK.DX9,却一直显示如上对话框,导致程序运行不起来. 于是我在网上找到了一个d3dx9d_40.dll,覆盖到C:\Windows\System32中,但是问题依然 ...

  6. ajax请求真实服务器数据示例

    // http://study.163.com/webDev/couresByCategory.htm // http://study.163.com/webDev/couresByCategory. ...

  7. 常用模块(random,os,json,pickle,shelve)

    常用模块(random,os,json,pickle,shelve) random import random print(random.random()) # 0-1之间的小数 print(rand ...

  8. 129. Sum Root to Leaf Numbers(从根节点加到叶子节点的和)

      Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a numb ...

  9. Struct2小组开发简单命名规范

    基本原则或者说理念:简单就是美 1.数据库名:项目名 2.表名:_model名 3.字段:和model中的属性名一致(不要和数据库名冲突) 4.用层来划分包:com.liying.bbs.action ...

  10. maven入门学习(一)

    一.maven介绍 1.软件开发中我们为什么要使用maven呢?(纯属个人体会观点,如有错误,敬请指正) (1)其一,企业岗位需求,目前的IT开发招聘岗位上,基本都要求会使用maven.        ...