jnwatson / py-lmdb

Universal Python binding for the LMDB 'Lightning' Database
http://lmdb.readthedocs.io/
Other
646 stars 106 forks source link

install error on windows with python 3.12 backend #351

Closed shelllee closed 5 months ago

shelllee commented 1 year ago

Affected Operating Systems

error log

pip install lmdb
Defaulting to user installation because normal site-packages is not writeable
Collecting lmdb
  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 "<string>", line 92, in <module>
      ModuleNotFoundError: No module named 'patch_ng'

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
        File "C:\Users\admin\AppData\Roaming\Python\Python312\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "C:\Users\admin\AppData\Roaming\Python\Python312\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\admin\AppData\Roaming\Python\Python312\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\admin\AppData\Local\Temp\pip-build-env-zcry2van\overlay\Lib\site-packages\setuptools\build_meta.py", line 355, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\admin\AppData\Local\Temp\pip-build-env-zcry2van\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in _get_build_requires
          self.run_setup()
        File "C:\Users\admin\AppData\Local\Temp\pip-build-env-zcry2van\overlay\Lib\site-packages\setuptools\build_meta.py", line 507, in run_setup
          super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
        File "C:\Users\admin\AppData\Local\Temp\pip-build-env-zcry2van\overlay\Lib\site-packages\setuptools\build_meta.py", line 341, 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.
Bye-lemon commented 1 year ago

I also met this error; you could try the approach in #352 . It's useful for me.

jnwatson commented 5 months ago

Just 'pip install patch-ng' fixes your problem. No need to change anything.