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

相关推荐
沛沛老爹6 分钟前
NumPy玩转数据科学
人工智能·python·机器学习·numpy·数据科学·多维数组·python库
晨曦54321014 分钟前
针对经济学大数据的 Python 爬虫实践指南
开发语言·爬虫·python
上位机付工16 分钟前
C#上位机实现报警语音播报
开发语言·c#·上位机·plc·运动控制卡·语音播报·报警播报
千千道19 分钟前
QT 中使用 QSettings 读写 ini 配置文件
开发语言·qt
liliangcsdn24 分钟前
标书生成过程中的prompt解读
人工智能·python·信息可视化·语言模型·prompt
Q_Q19632884751 小时前
python+uniapp基于微信小程序的高校二手商品交易系统
spring boot·python·微信小程序·django·flask·uni-app·node.js
benben0441 小时前
Unity3D仿星露谷物语开发67之创建新的NPC
开发语言·游戏·ui·c#·游戏引擎
matdodo1 小时前
【大数据】java API 进行集群间distCP 报错unresolvedAddressException
java·大数据·开发语言
老一岁1 小时前
c++set和pair的使用
开发语言·c++
k***a4292 小时前
Python 中设置布尔值参数为 True 来启用验证
开发语言·windows·python