离线安装python包

目前存在:网络限制不让访问外网或者外网速度慢下载依赖超时等问题,所以我们需要采用相对离线的方式安装我们的依赖。

第一种:公司内网安装python依赖,如果公司没有的话看看国内的源

阿里云 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/

对应代码:

pip3 install allure-pytest==2.8.6 -i  http://pypi.douban.com/simple/
 

第二种:相对于比较小的安装包直接放到项目中或者内网没有的包

从官网下载包:https://pypi.org/

 

 

 

 

 

 

 

 

推荐使用built Distribution安装:

下载好*.whl文件放到项目目录中安装命令:

pip install allure_pytest-2.9.45-py3-none-any.whl

source Distribution安装:

首先需要解压tar.gz,然后再执行:

 python3 setup.py install 

 

 

posted @ 2021-11-22 16:25  Tarzen  阅读(633)  评论(3编辑  收藏  举报