python离线安装第三方库和依赖


使用anaconda移植环境

https://zhuanlan.zhihu.com/p/87344422

 

 

使用pip移植环境

1.制作requirement.txt

pip freeze > requirement.txt

内网安装外部依赖包办法:

例如:安装pytest包得时候会顺带安装pytest依赖包

离线下载安装包
下载单个离线包 - pip download -d your_offline_packages <package_name>
批量下载离线包 - pip download -d your_offline_packages -r requirements.txt
离线安装
安装单个离线包 - pip install --no-index --find-links=/your_offline_packages/ package_name
批量安装离线包 - pip install --no-index --find-links=/your_offline_packages/ -r requirements.txt
![在这里插入图片描述](https://img-blog.csdnimg.cn/20190709151253998.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FpbmdsaW5nTFM=,size_16,color_FFFFFF,t_70
在这里插入图片描述
批量安装:
在这里插入图片描述
requirements文件内容:
在这里插入图片描述

 

参考:https://blog.csdn.net/qinglingLS/article/details/95198412

  https://www.jianshu.com/p/edb76391ba13

  https://www.cnblogs.com/Xjng/p/9392103.html


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM