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

相关推荐
曹轲恒18 分钟前
Java中断
java·开发语言
施棠海1 小时前
监听与回调的三个demo
java·开发语言
時肆4851 小时前
C语言造轮子大赛:从零构建核心组件
c语言·开发语言
赴前尘1 小时前
golang 查看指定版本库所依赖库的版本
开发语言·后端·golang
de之梦-御风2 小时前
【C#.Net】C#开发的未来前景
开发语言·c#·.net
web3.08889992 小时前
微店商品详情API实用
python·json·时序数据库
知乎的哥廷根数学学派2 小时前
基于数据驱动的自适应正交小波基优化算法(Python)
开发语言·网络·人工智能·pytorch·python·深度学习·算法
de之梦-御风2 小时前
【C#.Net】C#在工业领域的具体应用场景
开发语言·c#·.net
sunfove2 小时前
将 Python 仿真工具部署并嵌入个人博客
开发语言·数据库·python
Learner2 小时前
Python类
开发语言·python