twmht / python-rocksdb

Python bindings for RocksDB
BSD 3-Clause "New" or "Revised" License
276 stars 90 forks source link

Unable to install python-rocksdb #111

Open PsychoPunkSage opened 1 year ago

PsychoPunkSage commented 1 year ago

I am trying to download python-rocksdb for unable to do so. I'm following: https://python-rocksdb.readthedocs.io/en/latest/installation.html for installation... I'm stuck with

pip install git+git://github.com/twmht/python-rocksdb.git#egg=python-rocksdb

It is constantly giving error.

Collecting python-rocksdb
  Cloning git://github.com/twmht/python-rocksdb.git to /tmp/pip-install-9puobrlq/python-rocksdb_ab7d39b364564b55ae879ba434a0a680
  Running command git clone --filter=blob:none --quiet git://github.com/twmht/python-rocksdb.git /tmp/pip-install-9puobrlq/python-rocksdb_ab7d39b364564b55ae879ba434a0a680
  fatal: Could not read from remote repository.

  Please make sure you have the correct access rights
  and the repository exists.
  error: subprocess-exited-with-error

  × git clone --filter=blob:none --quiet git://github.com/twmht/python-rocksdb.git /tmp/pip-install-9puobrlq/python-rocksdb_ab7d39b364564b55ae879ba434a0a680 did not run successfully.
  │ exit code: 128
  ╰─> See above for output.

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

× git clone --filter=blob:none --quiet git://github.com/twmht/python-rocksdb.git /tmp/pip-install-9puobrlq/python-rocksdb_ab7d39b364564b55ae879ba434a0a680 did not run successfully.
│ exit code: 128
╰─> See above for output.

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

I also tried

pip install pyhton-rocksdb

but again it gives error

 ------------------------------------------------------------

      rocksdb/_rocksdb.pyx:2413:23: Accessing Python attribute not allowed without gil

      Error compiling Cython file:
      ------------------------------------------------------------
      ...

          def get_backup_info(self):
              cdef vector[backup.BackupInfo] backup_info

              with nogil:
                  self.engine.GetBackupInfo(cython.address(backup_info))
                                           ^
      ------------------------------------------------------------

      rocksdb/_rocksdb.pyx:2413:37: Constructing Python tuple not allowed without gil

      Error compiling Cython file:
      ------------------------------------------------------------
      ...

          def get_backup_info(self):
              cdef vector[backup.BackupInfo] backup_info

              with nogil:
                  self.engine.GetBackupInfo(cython.address(backup_info))
                                                  ^
      ------------------------------------------------------------
. . . . . . . . . . . . . . . . . . . . 

      rocksdb/_rocksdb.pyx:2413:44: Converting to Python object not allowed without gil
      Compiling rocksdb/_rocksdb.pyx because it changed.
      [1/1] Cythonizing rocksdb/_rocksdb.pyx
      Traceback (most recent call last):
        File "/home/psychopunk_sage/Hyperledger/Indy/.direnv/python-3.9.0/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/home/psychopunk_sage/Hyperledger/Indy/.direnv/python-3.9.0/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/home/psychopunk_sage/Hyperledger/Indy/.direnv/python-3.9.0/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
        File "/tmp/pip-build-env-j3unjfgg/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 434, in build_wheel
          return self._build_with_temp_dir(
        File "/tmp/pip-build-env-j3unjfgg/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 419, in _build_with_temp_dir
          self.run_setup()
        File "/tmp/pip-build-env-j3unjfgg/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 507, in run_setup
          super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
        File "/tmp/pip-build-env-j3unjfgg/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 341, in run_setup
          exec(code, locals())
        File "<string>", line 21, in <module>
        File "/tmp/pip-build-env-j3unjfgg/overlay/lib/python3.9/site-packages/setuptools/__init__.py", line 103, in setup
          return distutils.core.setup(**attrs)
        File "/tmp/pip-build-env-j3unjfgg/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
        File "/tmp/pip-build-env-j3unjfgg/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/tmp/pip-build-env-j3unjfgg/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/tmp/pip-build-env-j3unjfgg/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 989, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-j3unjfgg/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-j3unjfgg/overlay/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 369, in run
          self.run_command("build")
        File "/tmp/pip-build-env-j3unjfgg/overlay/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/tmp/pip-build-env-j3unjfgg/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 989, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-j3unjfgg/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-j3unjfgg/overlay/lib/python3.9/site-packages/setuptools/_distutils/command/build.py", line 131, in run
          self.run_command(cmd_name)
        File "/tmp/pip-build-env-j3unjfgg/overlay/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/tmp/pip-build-env-j3unjfgg/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 989, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-j3unjfgg/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-j3unjfgg/overlay/lib/python3.9/site-packages/setuptools/command/build_ext.py", line 88, in run
          _build_ext.run(self)
        File "/tmp/pip-build-env-j3unjfgg/overlay/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 345, in run
          self.build_extensions()
        File "/tmp/pip-build-env-j3unjfgg/overlay/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 467, in build_extensions
          self._build_extensions_serial()
        File "/tmp/pip-build-env-j3unjfgg/overlay/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 493, in _build_extensions_serial
          self.build_extension(ext)
        File "/tmp/pip-build-env-j3unjfgg/overlay/lib/python3.9/site-packages/setuptools/command/build_ext.py", line 249, in build_extension
          _build_ext.build_extension(self, ext)
        File "/tmp/pip-build-env-j3unjfgg/normal/lib/python3.9/site-packages/Cython/Distutils/build_ext.py", line 130, in build_extension
          new_ext = cythonize(
        File "/tmp/pip-build-env-j3unjfgg/normal/lib/python3.9/site-packages/Cython/Build/Dependencies.py", line 1154, in cythonize
          cythonize_one(*args)
        File "/tmp/pip-build-env-j3unjfgg/normal/lib/python3.9/site-packages/Cython/Build/Dependencies.py", line 1321, in cythonize_one
          raise CompileError(None, pyx_file)
      Cython.Compiler.Errors.CompileError: rocksdb/_rocksdb.pyx
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for python-rocksdb
Failed to build python-rocksdb
ERROR: Could not build wheels for python-rocksdb, which is required to install pyproject.toml-based projects

please provide solution

atharvjairath-entrupy commented 1 year ago

Same! Tried the pybind11 version as well

hanachaari commented 9 months ago

Try working with rocksdb-py 0.0.5 .it a library for Python bindings for RocksDB written in Rust. Use the documentation in PyPI. https://pypi.org/project/rocksdb-py/ @PsychoPunkSage

yangyang233333 commented 7 months ago

This pkg is dead.

raeder1986 commented 6 months ago

I faced this problem trying deploy Indy BC network on Ubuntu 20.04. For me helped: pip uninstall Cython && pip install Cython==0.29.37 and then pip install python-rocksdb