2

Trying to install berkeleydb package for python on Windows. Python 3.9.10 Pip 21.3.1

    d:\pip install berkeleydb

Collecting berkeleydb
  Using cached berkeleydb-18.1.5.tar.gz (430 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  ERROR: Command errored out with exit status 1:
   command: 'C:\Users\Admin\AppData\Local\Programs\Python\Python39\python.exe' 'C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' get_requires_for_build_wheel 'C:\Users\Admin\AppData\Local\Temp\tmpxcy8yhoh'
       cwd: C:\Users\Admin\AppData\Local\Temp\pip-install-jxt67cx4\berkeleydb_a9b2c56166664d789a2f35b3ac5cfc73
  Complete output (20 lines):
  Traceback (most recent call last):
    File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 363, in <module>
      main()
    File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 345, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 130, in get_requires_for_build_wheel
      return hook(config_settings)
    File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-03j2vyim\overlay\Lib\site-packages\setuptools\build_meta.py", line 162, in get_requires_for_build_wheel
      return self._get_build_requires(
    File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-03j2vyim\overlay\Lib\site-packages\setuptools\build_meta.py", line 143, in _get_build_requires
      self.run_setup()
    File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-03j2vyim\overlay\Lib\site-packages\setuptools\build_meta.py", line 267, in run_setup
      super(_BuildMetaLegacyBackend,
    File "C:\Users\Admin\AppData\Local\Temp\pip-build-env-03j2vyim\overlay\Lib\site-packages\setuptools\build_meta.py", line 158, in run_setup
      exec(compile(code, __file__, 'exec'), locals())
    File "setup.py", line 77, in <module>
      import setup3
    File "C:\Users\Admin\AppData\Local\Temp\pip-install-jxt67cx4\berkeleydb_a9b2c56166664d789a2f35b3ac5cfc73\setup3.py", line 346, in <module>
      with open(os.path.join(incdir, 'db.h'), 'r') as f :
  FileNotFoundError: [Errno 2] No such file or directory: 'db/include\\db.h'
  ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/c2/3f/a96d5caff3bbf0980fb47518ddb015a1df291f5ef31ee8c50ead21cb513a/berkeleydb-18.1.5.tar.gz#sha256=d8c2efbca9472f8848b13cce4f4904a5ea1e1540ee576e626a1491817832a50a (from https://pypi.org/simple/berkeleydb/). Command errored out with exit status 1: 'C:\Users\Admin\AppData\Local\Programs\Python\Python39\python.exe' 'C:\Users\Admin\AppData\Local\Programs\Python\Python39\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' get_requires_for_build_wheel 'C:\Users\Admin\AppData\Local\Temp\tmpxcy8yhoh' Check the logs for full command output.

I have no clues anymore. Totally removed python from my system and reinstalled it. Also with pip install bsddb3 I get a similar problem. However, I could install pandas without problems.

Hasse
  • 383
  • 3
  • 11

1 Answers1

0

You can try installing bsddb first as follows

pip install bsddb3-6.1.1-cp34-none-win_amd64.whl

if that does'nt work try this

$ sudo apt install libdb-dev
$ pip install bsddb3
Aamir Shah
  • 31
  • 7
  • I am on Windows for this project. So no sudo stuff, but run as admin gave no solution either – Hasse Jan 26 '22 at 23:07
  • The document says its deprecated for Python 3.9. In Windows use WSL and install bsddb3 by apt or apt-get: ```apt-get install -y python3-bsddb3``` outside of pip and pip3. – Aamir Shah Jan 26 '22 at 23:18
  • I am actually trying to install the succesor of bsddb => berkeleydb – Hasse Jan 26 '22 at 23:20
  • I just installed using ```conda install -c anaconda db4-cos6-x86_64```. Try installing inside the conda environment. Here is the link https://anaconda.org/anaconda/db4-cos6-x86_64 – Aamir Shah Jan 26 '22 at 23:27
  • Even inside conda I get the same error messages when using pip. But when using conda, I have also no need to update to berkeleydb and I can just stay on bsddb3. – Hasse Jan 27 '22 at 22:40
  • But also the bsddb3 conda package fails (retrying flexible solve......). Probably no windows version of this pacakge..... I do not like this conda stuff. It is the wrong solution for a problem. I rather update my python scripts to the latest libs than do environment management. Also the special package way of conda is a problem, not everything is in there. – Hasse Jan 27 '22 at 22:46