【发布时间】:2017-02-20 20:41:42
【问题描述】:
所以,我一直在尝试使用this site 处的说明为pythonpip install gutenberg 安装gutenberg 模块(因为我使用的是mac,所以使用brew 而不是pip)。每次我尝试这样做时,它都会返回:
pip install gutenberg
Collecting gutenberg
Using cached Gutenberg-0.4.2.tar.gz
Collecting bsddb3>=6.1.0 (from gutenberg)
Using cached bsddb3-6.2.1.tar.gz
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 /private/var/folders/53/zsh0zhwx635d_rss6hkgrknr0000gn/T/pip-build-Mn4wGp/bsddb3/
所以,我使用 brew (brew install berkeley-db) 安装了 berkeley 数据库,错误发生了变化:
pip install gutenberg
Requirement already satisfied (use --upgrade to upgrade): gutenberg in ./anaconda2/lib/python2.7/site-packages/Gutenberg-0.4.2-py2.7.egg
Collecting bsddb3>=6.1.0 (from gutenberg)
Using cached bsddb3-6.2.1.tar.gz
Complete output from command python setup.py egg_info:
Trying to use the Berkeley DB you specified...
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/53/zsh0zhwx635d_rss6hkgrknr0000gn/T/pip-build-FEd8dy/bsddb3/setup.py", line 40, in <module>
import setup2
File "setup2.py", line 350, in <module>
"version %d.%d" %db_ver)
TypeError: %d format: a number is required, not NoneType
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/53/zsh0zhwx635d_rss6hkgrknr0000gn/T/pip-build-FEd8dy/bsddb3/
我尝试过 easy_install、重新安装 setup-tools 和一堆其他东西。这是我尝试过的所有东西的链接:
Can't install via pip because of egg_info error
Python pip install gives "Command "python setup.py egg_info" failed with error code 1"
Python pip install fails: invalid command egg_info
pip fails to install anything, error: invalid command 'egg_info'
https://github.com/PokemonGoF/PokemonGo-Bot/issues/2919
当我说我已经尝试了所有这些时,我真的是指上面链接中的所有建议,所以也许我在这个过程中搞砸了。我不完全确定发生了什么,我已经研究了几个小时并且无法发现任何成功的解决方案。我不确定我是否在这里遗漏了一些东西,但如果有人有任何建议,那真的会有所帮助。
【问题讨论】:
-
你需要从这里安装 Berkeley DB:oracle.com/technetwork/database/database-technologies/…
标签: python installation pip egg