问题-小技巧-python-一键装第三方库

有网但是没第三方环境的地方,能快速装上环境

代码:

python 复制代码
import os

print('开始安装模块...')
#os.system('pip install (在这敲上你需要装的库) -i https://pypi.tuna.tsinghua.edu.cn/simple')
os.system('pip install requests -i https://pypi.tuna.tsinghua.edu.cn/simple')
os.system('pip install pymysql -i https://pypi.tuna.tsinghua.edu.cn/simple')
os.system('pip install lxml  -i https://pypi.tuna.tsinghua.edu.cn/simple')
os.system('pip install BeautifulSoup4 -i https://pypi.tuna.tsinghua.edu.cn/simple')
os.system('pip install jsonpath  -i https://pypi.tuna.tsinghua.edu.cn/simple')
os.system('pip install urllib3==1.26.2 -i https://pypi.tuna.tsinghua.edu.cn/simple')
os.system('pip install selenium==3.141.0 -i https://pypi.tuna.tsinghua.edu.cn/simple')
os.system('pip install aiohttp -i https://pypi.tuna.tsinghua.edu.cn/simple')
os.system('pip install aiofiles -i https://pypi.tuna.tsinghua.edu.cn/simple')
os.system('pip install pymongo -i https://pypi.tuna.tsinghua.edu.cn/simple')
os.system('pip install redis -i https://pypi.tuna.tsinghua.edu.cn/simple')
os.system('pip install pytesseract -i https://pypi.tuna.tsinghua.edu.cn/simple')
os.system('pip install pillow -i https://pypi.tuna.tsinghua.edu.cn/simple')
os.system('pip install numpy -i https://pypi.tuna.tsinghua.edu.cn/simple')
os.system('pip install scrapy -i https://pypi.tuna.tsinghua.edu.cn/simple')
print('所有模块安装完毕!')

可以编写自己所需要的第三方库列表,把这个python脚本拿到任何有python环境的地方都可以快速装自己所需要的第三方库

相关推荐
让我们一起加油好吗16 分钟前
【C++】类和对象(上)
开发语言·c++·visualstudio·面向对象
大霸王龙25 分钟前
Python对比两张CAD图并标记差异的解决方案
python·opencv·计算机视觉
magic 24542 分钟前
深入解析Promise:从基础原理到async/await实战
开发语言·前端·javascript
萧鼎1 小时前
PDFMathTranslate:让数学公式在PDF翻译中不再痛苦
python·pdf
只因从未离去1 小时前
黑马Java基础笔记-4
java·开发语言·笔记
@_猿来如此1 小时前
Django 实现电影推荐系统:从搭建到功能完善(附源码)
数据库·后端·python·django
言之。1 小时前
【Go语言】ORM(对象关系映射)库
开发语言·后端·golang
席万里1 小时前
Go语言企业级项目使用dlv调试
服务器·开发语言·golang
Python×CATIA工业智造1 小时前
爬虫技术入门:基本原理、数据抓取与动态页面处理
爬虫·python·pycharm
jerry6092 小时前
c++流对象
开发语言·c++·算法