问题-小技巧-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环境的地方都可以快速装自己所需要的第三方库

相关推荐
奔跑吧邓邓子23 分钟前
【Python爬虫(12)】正则表达式:Python爬虫的进阶利刃
爬虫·python·正则表达式·进阶·高级
码界筑梦坊1 小时前
基于Flask的京东商品信息可视化分析系统的设计与实现
大数据·python·信息可视化·flask·毕业设计
软件开发技术局1 小时前
撕碎QT面具(8):对控件采用自动增加函数(转到槽)的方式,发现函数不能被调用的解决方案
开发语言·qt
pianmian11 小时前
python绘图之箱型图
python·信息可视化·数据分析
csbDD1 小时前
2025年网络安全(黑客技术)三个月自学手册
linux·网络·python·安全·web安全
周杰伦fans2 小时前
C#中修饰符
开发语言·c#
yngsqq2 小时前
c# —— StringBuilder 类
java·开发语言
赔罪3 小时前
Python 高级特性-切片
开发语言·python
伊一大数据&人工智能学习日志3 小时前
selenium爬取苏宁易购平台某产品的评论
爬虫·python·selenium·测试工具·网络爬虫
说是用户昵称已存在3 小时前
Pycharm+CodeGPT+Ollama+Deepseek
ide·python·ai·pycharm