windows下适用pyinstaller打包paddleocr失败记录

使用管理员打开Anaconda Prompt

将anaconda文件夹打开权限各环境python打开权限

创建Python3.6环境:
conda create -n py36 python=3.6
activate py36

关闭所有其他占用该环境的窗口

升级setupTools和pip
python -m pip install --upgrade setupTools
python -m pip install --upgrade pip(如果失败,检查权限和其他窗口是否关闭,然后执行python -m ensurepip恢复pip)

pip install Shapely-1.7.1-cp36-cp36m-win_amd64.whl

conda install -c conda-forge python-levenshtein

pip install fasttext-0.9.2-cp36-cp36m-win_amd64.whl

pip install -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com paddleocr==2.0.1

pip install -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com common dual tight data prox

python -m pip install paddlepaddle==2.2.1 -i https://mirror.baidu.com/pypi/simple

pyinstaller test.py

最终报错:

Traceback (most recent call last):
  File "test.py", line 2, in 
  File "PyInstaller\loader\pyimod03_importers.py", line 476, in exec_module
  File "paddleocr\__init__.py", line 16, in 
  File "PyInstaller\loader\pyimod03_importers.py", line 476, in exec_module
  File "paddleocr\paddleocr.py", line 28, in 
ModuleNotFoundError: No module named 'tools'
[17880] Failed to execute script 'test' due to unhandled exception!

你可能感兴趣的:(windows,python,开发语言)