因为要使用 PaddleOCR,需要安装依赖。先通过 conda新建了虚拟环境,然后安装 PaddlePaddle,继续安装 PaddleOCR,上述过程我是在 VSCode的终端中处理,结果报错如下:
Downloading multidict-6.6.3-cp312-cp312-win_amd64.whl.metadata (5.4 kB)WARNING: Connection timed out while downloading.
ERROR: Could not install packages due to an OSError: [WinError 32] 另一个程序正在使用此文件,进程无法访问。: 'C:\\Users\\xxx\\AppData\\Local\\Temp\\pip-unpack-736fbb1e\\multidict-6.6.3-cp312-cp312-win_amd64.whl.metadata'
Consider using the `--user` option or check the permissions.
各种上网搜索解决方案,大致如下:
# 清理
pip cache purge
# 添加 user no-cache-dir 等参数安装
pip install --user --no-cache-dir paddleocr
还有一些建议,要关闭VSCode,在任务管理器中找到进程kill,更有一些建议是系统重启等,据说有效,但对我的情况,依然是报错:
Collecting paddleocrWARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out. (read timeout=15)")': /packages/d9/7f/2ea116c5d1a576786280ee3fa06388cd5bdcd274deafb10064dfa2d6f4c4/paddleocr-3.1.0-py3-none-any.whl.metadata
......
......
ERROR: Could not install packages due to an OSError: [WinError 32] 另一个程序正在使用此文件,进程无法访问。: 'C:\\Users\\xxx\\AppData\\Local\\Temp\\pip-unpack-se2grp_h\\huggingface_hub-0.33.2-py3-none-any.whl.metadata'
Check the permissions.
我发现前面有警告 timed out,感觉这是网络的问题,会不会是需要VPN?
尝试打开VPN,重新安装,非常顺利,一路ok。
问题就是这样莫名解决了。
建议有类似情况的,可以先打开VPN试试。