为什么我无法在Mac上安装Pillow?出现了一些错误

0 投票
1 回答
696 浏览
提问于 2025-04-17 23:41

这是我在安装Pillow时遇到的错误。我使用的是OS X Mavericks系统。
我尝试通过pip install来安装Pillow。

_imaging.c:391:28: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
                int temp = PyInt_AsLong(op);
                    ~~~~   ^~~~~~~~~~~~~~~~
_imaging.c:397:28: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
                int temp = PyInt_AsLong(op);
                    ~~~~   ^~~~~~~~~~~~~~~~
_imaging.c:407:28: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
                int temp = PyInt_AsLong(op);
                    ~~~~   ^~~~~~~~~~~~~~~~
_imaging.c:413:28: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
                int temp = PyInt_AsLong(op);
                    ~~~~   ^~~~~~~~~~~~~~~~
_imaging.c:520:17: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
            r = PyInt_AsLong(color);
              ~ ^~~~~~~~~~~~~~~~~~~
_imaging.c:533:25: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
                    r = PyInt_AS_LONG(color);
                      ~ ^~~~~~~~~~~~~~~~~~~~
/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/intobject.h:52:51: note: expanded from macro 'PyInt_AS_LONG'
#define PyInt_AS_LONG(op) (((PyIntObject *)(op))->ob_ival)
                           ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
_imaging.c:561:13: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
        r = PyInt_AsLong(color);
          ~ ^~~~~~~~~~~~~~~~~~~
_imaging.c:575:17: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
            r = PyInt_AsLong(color);
              ~ ^~~~~~~~~~~~~~~~~~~
_imaging.c:969:14: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
        *x = PyInt_AS_LONG(value);
           ~ ^~~~~~~~~~~~~~~~~~~~
/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/intobject.h:52:51: note: expanded from macro 'PyInt_AS_LONG'
#define PyInt_AS_LONG(op) (((PyIntObject *)(op))->ob_ival)
                           ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
_imaging.c:977:14: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
        *y = PyInt_AS_LONG(value);
           ~ ^~~~~~~~~~~~~~~~~~~~
/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/intobject.h:52:51: note: expanded from macro 'PyInt_AS_LONG'
#define PyInt_AS_LONG(op) (((PyIntObject *)(op))->ob_ival)
                           ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
_imaging.c:3102:15: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
        y = i / im->xsize;
          ~ ~~^~~~~~~~~~~
12 warnings generated.

结果终端就卡住了。其实我可以尝试其他安装方法,但我想知道为什么这个方法不行。

更新 让我安装失败的原因是我在安装webp的时候,它总是卡在那儿。

1 个回答

1

我明白了.. 我实际上是在这里通过以下命令安装了Pillow:

sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install pillow

我发现我在使用webp和little-cms的时候遇到了问题,所以我通过下载包的方式手动安装了它们..

撰写回答