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

相关推荐
Narutolxy4 分钟前
如何高效管理和迁移Python开发环境:从Conda到纯Python的转换指南
开发语言·python·conda
川爻13 分钟前
String类(STL开始)
开发语言·c++
萌狼蓝天13 分钟前
[python]Markdown图片引用格式批处理桌面应用程序
开发语言·python
醉公子~15 分钟前
批量爬取B站网络视频信息
爬虫·python·xpath·b站
懒大王爱吃狼20 分钟前
【Python自动化】Python实现微信自动回复(简单上手),60行代码轻松搞定!个性化自动回复机器人,零基础可学!
运维·开发语言·python·数据分析·自动化·学习方法
科学的发展-只不过是读大自然写的代码28 分钟前
Qt 日志输出的选择方案有多少
开发语言·qt
小白学大数据35 分钟前
爬虫进阶:Selenium与Ajax的无缝集成
大数据·开发语言·爬虫·selenium·ajax
取加若则_42 分钟前
C++入门(C语言过渡)
c语言·开发语言·数据结构·c++·算法
极度的坦诚就是无坚不摧43 分钟前
Python 数据容器的对比
开发语言·python
onetwo_2331 小时前
python实现接口自动化
开发语言·python·自动化