PaddlePaddle / PaddleOCR

Awesome multilingual OCR toolkits based on PaddlePaddle (practical ultra lightweight OCR system, support 80+ languages recognition, provide data annotation and synthesis tools, support training and deployment among server, mobile, embedded and IoT devices)
https://paddlepaddle.github.io/PaddleOCR/
Apache License 2.0
44.71k stars 7.86k forks source link

lmdb module install problem #11516

Closed emre32emre closed 5 months ago

emre32emre commented 10 months ago

I want to download the python lmdb module, but I constantly encounter this problem. Patch-ng module is installed. I also tried Python version 3.12 on older versions.

Collecting lmdb (from paddleocr) Using cached lmdb-1.4.1.tar.gz (881 kB) Installing build dependencies ... done Getting requirements to build wheel ... error error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [27 lines of output] py-lmdb: Using bundled liblmdb with py-lmdb patches; override with LMDB_FORCE_SYSTEM=1 or LMDB_PURE=1. Traceback (most recent call last): File "", line 92, in ModuleNotFoundError: No module named 'patch_ng'

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "C:\Users\WIN10\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
      main()
    File "C:\Users\WIN10\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\WIN10\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
      return hook(config_settings)
             ^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\WIN10\AppData\Local\Temp\pip-build-env-5u9gtozg\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in get_requires_for_build_wheel
      return self._get_build_requires(config_settings, requirements=['wheel'])
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\WIN10\AppData\Local\Temp\pip-build-env-5u9gtozg\overlay\Lib\site-packages\setuptools\build_meta.py", line 295, in _get_build_requires
      self.run_setup()
    File "C:\Users\WIN10\AppData\Local\Temp\pip-build-env-5u9gtozg\overlay\Lib\site-packages\setuptools\build_meta.py", line 480, in run_setup
      super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
    File "C:\Users\WIN10\AppData\Local\Temp\pip-build-env-5u9gtozg\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup
      exec(code, locals())
    File "<string>", line 94, in <module>
  Exception: Building py-lmdb from source on Windows requires the "patch-ng" python module.
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

gaomanyi commented 10 months ago

找到解决办法没?

emre32emre commented 10 months ago

no

找到解决办法没?

cobaltB12 commented 10 months ago

i'm also having this issue, when trying to install paddleocr. Had to downgrade to lower version of python, as lmdb only seems to support up to python 3.11 and I was using python 3.12. Then started facing a similar issue with PyMuPDF as well, found this link which said it only supports python 3.10. https://stackoverflow.com/questions/76379293/how-can-i-fix-the-error-in-pymupdf-when-installing-paddleocr-with-pip But tried this command from a comment pip install "paddleocr>=2.0.1" --upgrade PyMuPDF==1.21.1 and it worked on Python 3.11

Kang9401 commented 8 months ago

我也是,怎么搞?

jzhang533 commented 8 months ago

参看一下这个: https://github.com/jnwatson/py-lmdb/pull/352

szh-bash commented 7 months ago

i'm also having this issue, when trying to install paddleocr. Had to downgrade to lower version of python, as lmdb only seems to support up to python 3.11 and I was using python 3.12. Then started facing a similar issue with PyMuPDF as well, found this link which said it only supports python 3.10. https://stackoverflow.com/questions/76379293/how-can-i-fix-the-error-in-pymupdf-when-installing-paddleocr-with-pip But tried this command from a comment pip install "paddleocr>=2.0.1" --upgrade PyMuPDF==1.21.1 and it worked on Python 3.11

failed on Py3.12

Yapeng-Gao commented 6 months ago

python3.12安装失败. py-lmdb: Using bundled liblmdb with py-lmdb patches; override with LMDB_FORCE_SYSTEM=1 or LMDB_PURE=1. Traceback (most recent call last): File "", line 92, in ModuleNotFoundError: No module named 'patch_ng'

jzhang533 commented 6 months ago

python3.12安装失败. py-lmdb: Using bundled liblmdb with py-lmdb patches; override with LMDB_FORCE_SYSTEM=1 or LMDB_PURE=1. Traceback (most recent call last): File "", line 92, in ModuleNotFoundError: No module named 'patch_ng'

py-lmdb 还没有适配 python 3.12, 请参考: https://github.com/jnwatson/py-lmdb/pull/352 里的评论,自行构建 py-lmdb 的 python 3.12 的安装包。

Suvoo commented 5 months ago

I want to download the python lmdb module, but I constantly encounter this problem. Patch-ng module is installed. I also tried Python version 3.12 on older versions.

Collecting lmdb (from paddleocr) Using cached lmdb-1.4.1.tar.gz (881 kB) Installing build dependencies ... done Getting requirements to build wheel ... error error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [27 lines of output] py-lmdb: Using bundled liblmdb with py-lmdb patches; override with LMDB_FORCE_SYSTEM=1 or LMDB_PURE=1. Traceback (most recent call last): File "", line 92, in ModuleNotFoundError: No module named 'patch_ng'

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "C:\Users\WIN10\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
      main()
    File "C:\Users\WIN10\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\WIN10\AppData\Local\Programs\Python\Python312\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
      return hook(config_settings)
             ^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\WIN10\AppData\Local\Temp\pip-build-env-5u9gtozg\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in get_requires_for_build_wheel
      return self._get_build_requires(config_settings, requirements=['wheel'])
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Users\WIN10\AppData\Local\Temp\pip-build-env-5u9gtozg\overlay\Lib\site-packages\setuptools\build_meta.py", line 295, in _get_build_requires
      self.run_setup()
    File "C:\Users\WIN10\AppData\Local\Temp\pip-build-env-5u9gtozg\overlay\Lib\site-packages\setuptools\build_meta.py", line 480, in run_setup
      super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
    File "C:\Users\WIN10\AppData\Local\Temp\pip-build-env-5u9gtozg\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup
      exec(code, locals())
    File "<string>", line 94, in <module>
  Exception: Building py-lmdb from source on Windows requires the "patch-ng" python module.
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

The solution is provided in this issue : https://github.com/jnwatson/py-lmdb/pull/352