最近项目上用到Bata函数用到scipy
包
ModuleNotFoundError: No module named ‘scipy’ 执行 pip install scipy
报错:
There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.tuna.tsinghua.edu.cn', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate
经查询执行pip install scipy -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
还是报错 猜想可能是Python源的问题
修改为:pip install scipy -i http://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.com
问题解决
说明:这是阿里源 --trusted-host mirrors.aliyun.com 这是为了获得ssl证书的认证
1. 安装了python3之后,会有pip3
2. 当一台电脑同时有多个版本的Python的时候,用pip3就可以自动区分用Python3来安装库。避免和Python2发生冲突
3. 如果只安装了Python3,用pip还是pip3都一样的