PaddleOCR icon indicating copy to clipboard operation
PaddleOCR copied to clipboard

lmdb module install problem

Open emre32emre opened this issue 1 year ago • 8 comments

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.

emre32emre avatar Jan 19 '24 06:01 emre32emre

找到解决办法没?

gaomanyi avatar Jan 21 '24 18:01 gaomanyi

no

找到解决办法没?

emre32emre avatar Jan 22 '24 05:01 emre32emre

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

cobaltB12 avatar Jan 22 '24 11:01 cobaltB12

我也是,怎么搞?

Kang9401 avatar Mar 12 '24 09:03 Kang9401

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

jzhang533 avatar Mar 13 '24 02:03 jzhang533

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

szh-bash avatar Apr 30 '24 14:04 szh-bash

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'

Yapeng-Gao avatar May 07 '24 02:05 Yapeng-Gao

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 的安装包。

jzhang533 avatar May 07 '24 05:05 jzhang533

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

Suvoo avatar Jun 07 '24 22:06 Suvoo