question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Installation Error - fatal error: rocksdb/slice.h: No such file or directory

See original GitHub issue

Hi Stephan, upon installing pyrocksdb, I get the error below:

It has to do with the rocksdb libraries. I’m not sure if should place certain rocksdb files somewhere in order for this to work.

sudo pip install git+git://github.com/stephan-hof/pyrocksdb.git

Downloading/unpacking git+git://github.com/stephan-hof/pyrocksdb.git Cloning git://github.com/stephan-hof/pyrocksdb.git to /tmp/pip-mHdZe8-build Running setup.py egg_info for package from git+git://github.com/stephan-hof/pyrocksdb.git missing cimport in module ‘pair’: /usr/local/lib/python2.7/dist-packages/Cython/Includes/libcpp/deque.pxd Compiling rocksdb/_rocksdb.pyx because it changed. Cythonizing rocksdb/_rocksdb.pyx

Requirement already satisfied (use --upgrade to upgrade): setuptools in /usr/lib/python2.7/dist-packages (from pyrocksdb==0.1) Requirement already satisfied (use --upgrade to upgrade): Cython>=0.20 in /usr/local/lib/python2.7/dist-packages (from pyrocksdb==0.1) Installing collected packages: pyrocksdb Running setup.py install for pyrocksdb missing cimport in module ‘pair’: /usr/local/lib/python2.7/dist-packages/Cython/Includes/libcpp/deque.pxd

building 'rocksdb._rocksdb' extension
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c rocksdb/_rocksdb.cpp -o build/temp.linux-x86_64-2.7/rocksdb/_rocksdb.o -std=gnu++11 -O3 -Wall -Wextra -Wconversion -fno-strict-aliasing
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
rocksdb/_rocksdb.cpp:348:27: fatal error: rocksdb/slice.h: No such file or directory
 #include "rocksdb/slice.h"
                           ^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Complete output from command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-mHdZe8-build/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-N8DNKA-record/install-record.txt --single-version-externally-managed:
missing cimport in module 'pair': /usr/local/lib/python2.7/dist-packages/Cython/Includes/libcpp/deque.pxd

running install

running build

running build_py

creating build

creating build/lib.linux-x86_64-2.7

creating build/lib.linux-x86_64-2.7/rocksdb

copying rocksdb/interfaces.py -> build/lib.linux-x86_64-2.7/rocksdb

copying rocksdb/init.py -> build/lib.linux-x86_64-2.7/rocksdb

copying rocksdb/errors.py -> build/lib.linux-x86_64-2.7/rocksdb

creating build/lib.linux-x86_64-2.7/rocksdb/tests

copying rocksdb/tests/test_options.py -> build/lib.linux-x86_64-2.7/rocksdb/tests

copying rocksdb/tests/init.py -> build/lib.linux-x86_64-2.7/rocksdb/tests

copying rocksdb/tests/test_db.py -> build/lib.linux-x86_64-2.7/rocksdb/tests

running egg_info

creating pyrocksdb.egg-info

writing requirements to pyrocksdb.egg-info/requires.txt

writing pyrocksdb.egg-info/PKG-INFO

writing top-level names to pyrocksdb.egg-info/top_level.txt

writing dependency_links to pyrocksdb.egg-info/dependency_links.txt

writing manifest file ‘pyrocksdb.egg-info/SOURCES.txt’

warning: manifest_maker: standard file ‘-c’ not found

reading manifest file ‘pyrocksdb.egg-info/SOURCES.txt’

writing manifest file ‘pyrocksdb.egg-info/SOURCES.txt’

copying rocksdb/_rocksdb.cpp -> build/lib.linux-x86_64-2.7/rocksdb

running build_ext

building ‘rocksdb._rocksdb’ extension

creating build/temp.linux-x86_64-2.7

creating build/temp.linux-x86_64-2.7/rocksdb

x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c rocksdb/_rocksdb.cpp -o build/temp.linux-x86_64-2.7/rocksdb/_rocksdb.o -std=gnu++11 -O3 -Wall -Wextra -Wconversion -fno-strict-aliasing

cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]

rocksdb/_rocksdb.cpp:348:27: fatal error: rocksdb/slice.h: No such file or directory

#include “rocksdb/slice.h”

                       ^

compilation terminated.

error: command ‘x86_64-linux-gnu-gcc’ failed with exit status 1


Cleaning up… Command /usr/bin/python -c “import setuptools;file=‘/tmp/pip-mHdZe8-build/setup.py’;exec(compile(open(file).read().replace(‘\r\n’, ‘\n’), file, ‘exec’))” install --record /tmp/pip-N8DNKA-record/install-record.txt --single-version-externally-managed failed with error code 1 in /tmp/pip-mHdZe8-build Storing complete log in /home/a/.pip/pip.log

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

15reactions
cpdeancommented, Sep 26, 2018

On OSX I was able to resolve this issue by first installing rocksdb using homebrew:

brew install rocksdb
3reactions
dselivanovcommented, Mar 25, 2015

@guguncube, thanks for installation guide. One additional thing was needed for me: add sudo ldconfig after copying shared libraries:

# globally install librocksdb.so library 
sudo cp librocksdb.so /usr/local/lib

# globally install headers 
sudo mkdir -p /usr/local/include/rocksdb/
sudo cp -r ./include/* /usr/local/include/
# update cache
sudo ldconfig

It would be nice if you will update your post.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to install pyrocksdb against RocksDB master
I tried to checkout various versions of RocksDB (3.5, 3.6, 3.8, 3.9) and still no luck. I am using Python 3.4 on a...
Read more >
ROCKSDB Installation Problem Brief Introduction
Here is the version of Python that is installed under Ubuntu. ... solve the problem " Fatal error:rocksdb/slice.h:no such file or directory".
Read more >
python-rocksdb - Bountysource
When running pip install python-rocksdb the installer exits with an following error message: 'rocksdb/utilities/backupable_db.h' file not found.
Read more >
ERROR: Failed building wheel for python-rocksdb-docker
Read the error message, where it is clearly stated you are missing a header file: fatal error: rocksdb/slice.h: No such file or directory...
Read more >
installation error. - Google Groups
So far i've tried to install cockroach-db on ubuntu. i've got this error : e/rocksdb.go:25:24: fatal error: rocksdb/c.h: No such file or directory...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found