所以,我一直在尝试使用this site上的指示为python pip 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
当我说我已经尝试了所有这些时,我的确意味着上面链接中的所有建议,所以也许我在这个过程中弄乱了一些东西。我不完全确定发生了什么,我已经工作了几个小时,并且无法找到任何成功的解决方案。我不确定我是否在这里遗漏了一些东西,但如果有人有任何建议,那真的会有所帮助。
答案 0 :(得分:0)
只是我身边的一个补充...... 我在我的 Windows 10 for python 3.4:
上解决了这个问题转到Powershell窗口并在下面输入:
1) Update pip >>>>> py -3.4 -m pip install --upgrade pip
2) Install Numpy >>>>> py -3.4 -m pip install numpy
3) Install Matplotlib >>>> py -3.4 -m pip install matplotlib