这是一个Python 3.7.9可用的EasyOCR环境相关模块的版本
requirements.txt
altgraph==0.17.4
certifi==2025.10.5
charset-normalizer==3.4.4
easyocr==1.4.1
greenlet==2.0.2
idna==3.10
imageio==2.9.0
importlib-metadata==6.7.0
MouseInfo==0.1.3
networkx==2.6.3
ninja==1.11.1.4
numpy==1.21.6
opencv-python-headless==4.12.0.88
packaging==24.0
pefile==2024.8.26
Pillow==8.2.0
playwright==1.35.0
PyAutoGUI==0.9.54
pyclipper==1.3.0.post6
pyee==9.0.4
PyGetWindow==0.0.9
pyinstaller==5.13.2
pyinstaller-hooks-contrib==2024.7
PyMsgBox==2.0.1
pyperclip==1.11.0
PyRect==0.2.0
#PyScreeze==1.0.1
pyscreeze==0.1.28
python-bidi==0.6.2
pytweening==1.2.0
PyWavelets==1.3.0
#pywin32==308 #在windows server 2016上死活不行
pywin32==304
pywin32-ctypes==0.2.3
PyYAML==6.0.1
requests==2.31.0
scikit-image==0.19.3
scipy==1.7.3
shapely==2.0.7
tifffile==2021.11.2
#torch==1.11.0+cpu
#torchaudio==0.11.0+cpu
#torchvision==0.12.0+cpu
typing_extensions==4.7.1
urllib3==2.0.7
zipp==3.15.0
以上的requirements.txt还包括了操作鼠标、键盘的模块,还有图片裁剪,这些不是easyOCR需要的,我这个环境的用于编写一个程序,需要用到win32gui。
如果是内网的话,pip需要设置代理,为了加快速度,可以使用国内的清华源。windows代理的话可以安装一个试用版的ccproxy 8.0,为了测试代理,可以用telnet,或者curl,或者浏览器安装插件Proxy SwitchyOmega 2.5.21来测试代理,使用代理的话,如果使用socks代理,需要pip先下载一个可直接安装的PySocks-1.7.1-py3-none-any.whl,进行离线安装。然后激活 .venv 环境(如果有这种环境的话),然后设置2个变量HTTP_PROXY,HTTPS_PROXY,windows用set命令设置。
浏览器代理先不管,主要是pip代理能设置好,浏览器代理是容易设置的。
如果不是内网的话,就不使用代理,就更简单了。
SOCKS 代理
(.venv) c:\code\python\WeChat>pip install d:\PySocks-1.7.1-py3-none-any.whl
Processing d:\pysocks-1.7.1-py3-none-any.whl
Installing collected packages: PySocks
Successfully installed PySocks-1.7.1
成功
c:\code\python\wechat.venv\scripts\python.exe -m pip install --upgrade pip --proxy socks5h://110.xx.xx.xx:1080 -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install setuptools wheel build --upgrade --proxy socks5h://110.xx.xx.xx:1080 -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn
pip install -r requirements.txt --proxy socks5h://110.xx.xx.xx:1080 -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install MouseInfo==0.1.3 --index-url https://pypi.org/simple/ --proxy socks5h://110.xx.xx.xx:1080
pip install PyAutoGUI==0.9.54 --index-url https://pypi.org/simple/ --proxy socks5h://110.xx.xx.xx:1080
pip install pillow mouseinfo pygetwindow pymsgbox pyscreeze -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn --proxy socks5h://110.xx.xx.xx:1080
对于 SOCKS 代理,可尝试设为:
windows 全局变量
HTTP_PROXY=socks5h://110.xx.xx.xx:1080
HTTPS_PROXY=socks5h://110.xx.xx.xx:1080
但前提是已安装 PySocks,否则无效!
【会话变量】
set HTTP_PROXY=socks5h://110.xx.xx.xx:1080
set HTTPS_PROXY=socks5h://110.xx.xx.xx:1080
综合建议操作流程
步骤 1:确认 Python 版本 ≥ 3.7
python --version # 应 >= 3.7,推荐 3.8~3.10
步骤 2:单独安装 PyTorch(带 +cpu)
pip install torch1.11.0+cpu torchvision0.12.0+cpu -f https://download.pytorch.org/whl/cpu/torch_stable.html
步骤 3:安装其他依赖(排除 torch)
编辑 requirements.txt,临时注释掉 torch 相关行:
#torch1.11.0+cpu
#torchvision0.12.0+cpu
tifffile==2021.11.2
…
然后运行:
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host pypi.tuna.tsinghua.edu.cn
playwright install chromium --proxy socks5h://110.xx.xx.xx:1080
2025-11-07
6088

被折叠的 条评论
为什么被折叠?



