pychram导入包出错解决方法(终端法)
原理:这是因为网络的问题,需要使用国内的镜像源来加速,比如豆瓣源pypi.douban.com(若以下方法沒解決请百度其他镜像源补上)
pip install ddt -i http://pypi.douban.com/simple/ --trusted-host pypi.douban.com
常用镜像源:
通过几次 pip 的使用,对于默认的 pip 源的速度实在无法忍受,于是便搜集了一些国内的pip源,如下:
阿里云 http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣(douban) http://pypi.douban.com/simple/
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/