Vivek
Vivek

Reputation: 175

Installation of Python-Rocksdb

I'm trying to install Python-RocksDB package.

I tried using sudo pip3 install python-rocksdb sudo pip install python-rocksdb

However, I get this message Requirement already satisfied: python-rocksdb in /usr/local/lib/python3.6/dist-packages

I also tried cloning the github repository and installing it from source. Somehow that doesn't get installed either. Is there anything else to resolve this?

Upvotes: 4

Views: 5512

Answers (4)

HANA
HANA

Reputation: 11

It worked for me with

sudo apt install rocksdb-tools librocksdb6.11 librocksdb-dev libsnappy-dev liblz4-dev

then

pip install rockdb-py

For further documentation, check PyPI documentation rockdb-py 0.0.5 PiPY documentation.

Upvotes: 1

Serge
Serge

Reputation: 1497

Let it be for the future:

apt-get update
apt install -y \
gcc g++ python-dev librocksdb-dev build-essential \
libsnappy-dev zlib1g-dev libbz2-dev libgflags-dev \
liblz4-dev libzstd-dev curl

Upvotes: 1

RogerS
RogerS

Reputation: 1441

This is how I installed in Ubuntu 20.04, without compiling rocksdb from scratch.

sudo apt install rocksdb-tools librocksdb5.17 librocksdb-dev libsnappy-dev liblz4-dev

After I could do this:

sudo pip3 install python-rocksdb

Then inside python3:

import rocksdb
# your python code using rocksdb

Upvotes: 4

BPDESILVA
BPDESILVA

Reputation: 2198

Install rocksdb and Cython.

Simplified :

Solution 1

pip install Cython
pip install python-rocksdb

Solution 2

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

Try the manual method :

    git clone https://github.com/facebook/rocksdb.git
    cd rocksdb
    mkdir build && cd build
    cmake ..
    make
    sudo make install INSTALL_PATH=/usr

Now you have rocksdb installed, Then make a new python virtual environment:

pip install python-rocksdb

Upvotes: 5

Related Questions