【问题标题】:Why can't I install Pillow on my mac? It gives some errors为什么我不能在我的 mac 上安装 Pillow?它给出了一些错误
【发布时间】:2014-05-02 03:54:06
【问题描述】:

这是安装 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 时。它总是挂在那里。

【问题讨论】:

  • 这些似乎都可以安全地忽略警告。输出中是否有错误?
  • 很难从你提供的内容中分辨出来 - 如果成功,尝试使用python setup.py build_ext 后跟python setup.py build 构建 Pillow;然后回来并发布任何与点子运行不同的结果,正如他们可能会告诉的那样。
  • @RobAgar 它只是在 pip 安装后挂起
  • @fish2000 我尝试从此处pillow.readthedocs.org/en/latest/installation.html 安装先决条件,但一直在安装 webp 和 littlecms。它只是挂起..我尝试下载它并执行 python setup.py build_ext 但仍然是上面遇到的相同错误..

标签: python django macos pillow webp


【解决方案1】:

我明白了..我在这里实际做的是通过安装Pillow

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

我意识到我在使用 webp 和 little-cms 时遇到了问题,所以我通过下载包手动安装了它们..

【讨论】:

  • 你好列昂尼德。我使用了您的 hack,它似乎已成功安装,但我无法在 python shell 中导入它,并且 django runserver 无法识别它的存在。任何想法可能发生了什么?
猜你喜欢
  • 2012-02-18
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-12-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多