python3 -m pip install --upgrade pip
查看镜像源 pip config list
指定镜像源更新依赖 pip3 install numpy -i https://pypi.tuna.tsinghua.edu.cn/simple
设置全局镜像源:
pip config set global.index-url mirror_url_path #指定镜像服务器域名地址
pip config set global.timeout number #设置连接超时时间,以秒为单位,指定number秒后,连接超时
pip config set install.trusted-host hostname #将以上镜像服务器的域名加入到Install命令的信任域名列表内
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
#国内比较常用的镜像地址,本人选择的是阿里云的镜像服务
http://pypi.douban.com/simple/ #豆瓣
https://pypi.tuna.tsinghua.edu.cn/simple #清华开源
https://mirrors.aliyun.com/pypi/simple/ #阿里云,比较靠谱,最起码可以安装jupyter
https://pypi.mirrors.ustc.edu.cn/simple/ #中科大
https://pypi.hustunique.com/ #华中理工
https://pypi.sdutlinux.org/ #山东理工
requirements.txt 是 python 在不同的环境中对依赖包的一种约定,用于列出 Python 项目中所有的依赖包以及对应版本号的文本文件。一般在项目的在工程目录下。
pkg==version 等于版本
pkg>version 大于版本
pkg=version 大于等于版本
pkg= 1.0,
requirements.txt
中的包pip install -r requirements.txt
requirements.txt
中的包pip freeze > requirements.txt
本文来自博客园,作者:柯南小海盗,转载请注明原文链接:https://www.cnblogs.com/knxhd/p/18356238
参与评论
手机查看
返回顶部