gpt4 book ai didi

python - 使用 Pip 安装 Python 库

转载 作者:太空宇宙 更新时间:2023-11-03 18:34:29 25 4
gpt4 key购买 nike

预先感谢您的帮助!

我正在尝试使用 Pip 1.5.2 安装一组 Python 2.7.5 库。我正在关注directions to install NuPIC on my mac (OS X Mavericks) 。一切都很顺利,直到我运行了这行代码:

sudo pip install --allow-all-external --allow-unverified PIL --allow-unverified psutil -r $NUPIC/external/common/requirements.txt

我收到此错误:

building '_imagingft' extension

cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers -I/usr/local/include/freetype2 -IlibImaging -I/System/Library/Frameworks/Python.framework/Versions/2.7/include -I/usr/local/include -I/usr/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _imagingft.c -o build/temp.macosx-10.9-intel-2.7/_imagingft.o

clang: warning: argument unused during compilation: '-mno-fused-madd'

_imagingft.c:73:10: fatal error: 'freetype/fterrors.h' file not found

#include <freetype/fterrors.h>

^

1 error generated.

error: command 'cc' failed with exit status 1

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/tmp/pip_build_root/PIL/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-vJHHeE-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/tmp/pip_build_root/PIL
Storing debug log for failure in /Users/aaronclaytondunn/Library/Logs/pip.log

这是要求文件 ($NUPIC/external/common/requirements.txt):

#See http://www.pip-installer.org/en/latest/requirements.html for details
asteval==0.9.1
mock==1.0.1
ordereddict==1.1
PIL==1.1.7
psutil==1.0.1
pylint==0.28.0
pytest==2.4.2
pytest-cov==1.6
pytest-xdist==1.8
python-dateutil==2.1
PyYAML==3.10
unittest2==0.5.1
validictory==0.9.1
PyMySQL==0.5
DBUtils==1.1
numpy==1.7.1
tweepy==2.1

它运行了一段时间,所以我认为它成功安装了一些库并在其中一个上崩溃了。有什么想法出了什么问题吗?

最佳答案

这里的“链接”问题Error installing Python Image Library using pip on Mac OS X 10.9回答这个问题(得票最高的答案)。基本上 PIL 不再正确安装 freetype header 。您需要将新位置链接到/usr/include/freetype。

关于python - 使用 Pip 安装 Python 库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21845396/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com