Search code examples
pythonscrapyvirtualenvraspbianraspberry-pi3

How to fix "Can't find local Berkeley DB" error?


I'm trying to install scrapy-deltafetch in a virtual-environment (as described here) on my new raspberry pi 3 with Raspbian.

When I'm running pip install scrapy-deltafetch in my virtualenv, I'm getting something like this:

python setup.py egg_info: Can't find a local Berkeley DB installation

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-ib6d93/bsddb3/

However when I'm running sudo pip install scrapy-deltafetch outside of my virtual-environment everything works fine.

Does anybody has an idea of how to install scrapy-deltafetch in the virtualenvironment?


Solution

  • Your system is missing Berkeley DB, which is used by DeltaFetch to store requests data.

    So, first install Berkeley DB in your system (found this tutorial in a quick search).

    After that, you have to install the bsddb3 Python package (you can follow the instructions from this answer).

    Edit (2020):

    This should work:

    $ sudo apt install libdb-dev
    $ pip install bsddb3