当前位置:网站首页>How to automatically install pythn third-party libraries
How to automatically install pythn third-party libraries
2022-07-05 18:27:00 【Terminal frog】
Recently, I often have to change my computer , After changing the computer, synchronize your previous python Environmental Science , So we have a simple solution
- Use on the original computer pip list Print out the installed third-party library
pip list
give the result as follows - Finish installing on your new computer python After environment , Run the following script
import os import re def auto_install(fn:str): # Input fn by pip list Format of output in libPatten = re.compile("\s*(\w+)\s*([\d\.]+)") with open(fn,"r") as f: lines = f.readlines() for line in lines: libRe = libPatten.match(line) if libRe: libname = libRe.group(1) version = libRe.group(2) os.system("pip install "+libname +"=="+version) if __name__ == "__main__": fn = r"xxx.txt" auto_install(fn)
- Wait for the auto run script to install
It hasn't been updated for a long time , Ah , Self created updates are annoying
边栏推荐
- 爱因斯坦求和einsum
- Numerical calculation method chapter8 Numerical solutions of ordinary differential equations
- 彻底理解为什么网络 I/O 会被阻塞?
- 瀚升优品app翰林优商系统开发功能介绍
- [utiliser Electron pour développer le Bureau sur youkirin devrait]
- [QNX Hypervisor 2.2用户手册]6.3.2 配置VM
- Star Ring Technology launched transwarp Navier, a data element circulation platform, to help enterprises achieve secure data circulation and collaboration under privacy protection
- LeetCode 6111. 螺旋矩阵 IV
- 【PaddlePaddle】 PaddleDetection 人脸识别 自定义数据集
- 吴恩达团队2022机器学习课程,来啦
猜你喜欢
记录Pytorch中的eval()和no_grad()
rust统计文件中单词出现的次数
U-Net: Convolutional Networks for Biomedical Images Segmentation
node_ Exporter memory usage is not displayed
Sophon autocv: help AI industrial production and realize visual intelligent perception
Vulnhub's darkhole_ two
基于can总线的A2L文件解析(3)
Star Ring Technology launched transwarp Navier, a data element circulation platform, to help enterprises achieve secure data circulation and collaboration under privacy protection
彻底理解为什么网络 I/O 会被阻塞?
爬虫01-爬虫基本原理讲解
随机推荐
SAP 特征 特性 说明
《力扣刷题计划》复制带随机指针的链表
sample_rate(采樣率),sample(采樣),duration(時長)是什麼關系
爬虫01-爬虫基本原理讲解
LeetCode 6111. 螺旋矩阵 IV
Share: ZTE Yuanhang 30 Pro root unlock BL magick ZTE 7532n 8040n 9041n brush mask original brush package root method Download
Notes on common management commands of openshift
华夏基金:基金行业数字化转型实践成果分享
开户注册股票炒股安全吗?有没有风险的?靠谱吗?
Leetcode notes: Weekly contest 300
金太阳开户安全吗?万一免5开户能办理吗?
[paddleclas] common commands
Clickhouse (03) how to install and deploy Clickhouse
ViewPager + RecyclerView的内存泄漏
[QNX hypervisor 2.2 user manual]6.3.2 configuring VM
The 10th global Cloud Computing Conference | Huayun data won the "special contribution award for the 10th anniversary of 2013-2022"
Le cours d'apprentissage de la machine 2022 de l'équipe Wunda arrive.
To solve the stubborn problem of Lake + warehouse hybrid architecture, xinghuan Technology launched an independent and controllable cloud native Lake warehouse integrated platform
Multithreading (I) processes and threads
Sophon autocv: help AI industrial production and realize visual intelligent perception