DOsinga / deep_learning_cookbook

Deep Learning Cookbox
Apache License 2.0
686 stars 335 forks source link

bsddb3 install fails during pip install -r requirements.txt #62

Closed nathanhillyer closed 5 years ago

nathanhillyer commented 5 years ago

Getting error:

Collecting bsddb3==6.2.6 (from -r requirements.txt (line 21))
  Downloading https://files.pythonhosted.org/packages/e9/fc/ebfbd4de236b493f9ece156f816c21df0ae87ccc22604c5f9b664efef1b9/bsddb3-6.2.6.tar.gz (239kB)
    100% |████████████████████████████████| 245kB 5.7MB/s 
    Complete output from command python setup.py egg_info:
    Can't find a local Berkeley DB installation.
    (suggestion: try the --berkeley-db=/path/to/bsddb option)

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

Installed Berkeley DB but have no idea how to use the --berkeley-db=/path/to/bsddb option

nathanhillyer commented 5 years ago

Figured it out.

Apparently you can also use the BERKELEY_DB environment variable.

But I ran into another error:

ERROR: Trying to use the Berkeley DB you specified...
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/tm/x76_y5t15vgcw9mycdc4cshc0000gn/T/pip-install-tajo11ks/bsddb3/setup.py", line 42, in <module>
        import setup3
      File "/private/var/folders/tm/x76_y5t15vgcw9mycdc4cshc0000gn/T/pip-install-tajo11ks/bsddb3/setup3.py", line 354, in <module>
        db_ver = (int(fullverstr[0]), int(fullverstr[2]))
    ValueError: invalid literal for int() with base 10: '.'

Well, apparently the python lib breaks on versions 10 or higher (if major version has 2 characters).

So I ran brew uninstall berkeley-db.

Then brew install berkeley-db@4. This installs version 4, which prevented pip from choking.

nathanhillyer commented 5 years ago

To set the environment variable I put:

export PATH="/usr/local/opt/berkeley-db@4/bin:$PATH"

in my zshrc.