简体   繁体   English

无法在 macOS Catalina 10.15.4 上安装 bsddb3 Python package

[英]Unable to install bsddb3 Python package on macOS Catalina 10.15.4

I've used Homebrew to install berkeley-db and am now struggling to install the bsddb3 Python package.我已经使用 Homebrew 安装了 berkeley-db,现在正在努力安装 bsddb3 Python package。 Any help would be much appreciated.任何帮助将非常感激。

bash-3.2$ BERKELEYDB_DIR=/usr/local/Cellar/berkeley-db/18.1.32_1 pip install bsddb3
Collecting bsddb3
  Using cached bsddb3-6.2.7.tar.gz (437 kB)
    ERROR: Command errored out with exit status 1:
     command: /Users/ryonlife/.local/share/virtualenvs/peg-scrapy-pegbot-ndRdHu61/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/00/9r872f810sz481x6k9pqkldw0000gn/T/pip-install-03k5olgq/bsddb3/setup.py'"'"'; __file__='"'"'/private/var/folders/00/9r872f810sz481x6k9pqkldw0000gn/T/pip-install-03k5olgq/bsddb3/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/00/9r872f810sz481x6k9pqkldw0000gn/T/pip-install-03k5olgq/bsddb3/pip-egg-info
         cwd: /private/var/folders/00/9r872f810sz481x6k9pqkldw0000gn/T/pip-install-03k5olgq/bsddb3/
    Complete output (8 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/00/9r872f810sz481x6k9pqkldw0000gn/T/pip-install-03k5olgq/bsddb3/setup.py", line 42, in <module>
        import setup3
      File "/private/var/folders/00/9r872f810sz481x6k9pqkldw0000gn/T/pip-install-03k5olgq/bsddb3/setup3.py", line 354, in <module>
        db_ver = (int(fullverstr[0]), int(fullverstr[2]))
    ValueError: invalid literal for int() with base 10: '.'
    Trying to use the Berkeley DB you specified...
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

The trick for me was using Homebrew to install berkeley-db@4, rather than berkeley-db.对我来说,诀窍是使用 Homebrew 安装 berkeley-db@4,而不是 berkeley-db。

brew install berkeley-db@4
BERKELEYDB_DIR=$(brew --prefix berkeley-db@4) pip install bsddb3

Do not report this issue to Homebrew/brew or Homebrew/core!不要将此问题报告给 Homebrew/brew 或 Homebrew/core!

Error: You are using macOS 11.1.错误:您使用的是 macOS 11.1。 We do not provide support for this pre-release version.我们不为此预发布版本提供支持。 You will encounter build failures with some formulae.您将遇到使用某些公式的构建失败。 Please create pull requests instead of asking for help on Homebrew's GitHub, Discourse, Twitter or IRC.请创建拉取请求,而不是在 Homebrew 的 GitHub、Discourse、Twitter 或 IRC 上寻求帮助。 You are responsible for resolving any issues you experience while you are running this pre-release version.您有责任解决在运行此预发布版本时遇到的任何问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM