当前位置:网站首页>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
边栏推荐
- Xiaobai getting started with NAS - quick building private cloud tutorial series (I) [easy to understand]
- 星环科技重磅推出数据要素流通平台Transwarp Navier,助力企业实现隐私保护下的数据安全流通与协作
- Sophon CE Community Edition is online, and free get is a lightweight, easy-to-use, efficient and intelligent data analysis tool
- 记一次使用Windbg分析内存“泄漏”的案例
- Sophon KG升级3.1:打破数据间壁垒,解放企业生产力
- Sophon base 3.1 launched mlops function to provide wings for the operation of enterprise AI capabilities
- Logical words in Articles
- 爬虫01-爬虫基本原理讲解
- Check namespaces and classes
- Huaxia Fund: sharing of practical achievements of digital transformation in the fund industry
猜你喜欢
Memory management chapter of Kobayashi coding
Huaxia Fund: sharing of practical achievements of digital transformation in the fund industry
Fix vulnerability - mysql, ES
LeetCode 6111. Spiral matrix IV
Find the first k small element select_ k
The 2022 China Xinchuang Ecological Market Research and model selection evaluation report released that Huayun data was selected as the mainstream manufacturer of Xinchuang IT infrastructure!
如何获取飞机穿过雷达两端的坐标
分享:中兴 远航 30 pro root 解锁BL magisk ZTE 7532N 8040N 9041N 刷机 刷面具原厂刷机包 root方法下载
Vulnhub's darkhole_ two
FCN: Fully Convolutional Networks for Semantic Segmentation
随机推荐
Sophon AutoCV:助力AI工业化生产,实现视觉智能感知
What is the reason why the video cannot be played normally after the easycvr access device turns on the audio?
Gimp 2.10 tutorial "suggestions collection"
怎么自动安装pythn三方库
Maximum artificial island [how to make all nodes of a connected component record the total number of nodes? + number the connected component]
【HCIA-cloud】【1】云计算的定义、什么是云计算、云计算的架构与技术说明、华为云计算产品、华为内存DDR配置工具说明
Tupu software digital twin | visual management system based on BIM Technology
LeetCode 6109. Number of people who know the secret
The 2022 China Xinchuang Ecological Market Research and model selection evaluation report released that Huayun data was selected as the mainstream manufacturer of Xinchuang IT infrastructure!
Sophon KG升级3.1:打破数据间壁垒,解放企业生产力
JDBC reads a large amount of data, resulting in memory overflow
Vulnhub's darkhole_ two
开户注册挖财安全吗?有没有风险的?靠谱吗?
Xiaobai getting started with NAS - quick building private cloud tutorial series (I) [easy to understand]
兄弟组件进行传值(显示有先后顺序)
Find the first k small element select_ k
Leetcode notes: Weekly contest 300
Notes on common management commands of openshift
Clickhouse (03) how to install and deploy Clickhouse
[QNX hypervisor 2.2 user manual]6.3.2 configuring VM