0

Recently I upgraded my system to MacOSX 10.9.4. My whole development environment is messed up right now. I'm trying to re-install or recover modules, libraries, even some applications.

I'm using Django1.6, and one of my models have ImageField in it, which of course needs PIL or pillow to be installed. I couldn't manage to install Pillow though, because of the following warnings:

/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/abstract.h:434:25: note: expanded from macro 'PyObject_Length'
    #define PyObject_Length PyObject_Size
                            ^
    _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:3224:15: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
            y = i / im->xsize;
              ~ ~~^~~~~~~~~~~

I searched around, found couple of solutions but didn't work for me. Right now, when I try to do brew install pillow it says pillow2.5.1 already install, it's just not linked. Note that I used this solution lately: https://stackoverflow.com/a/22651557/878170

How can I solve this problem?

Community
  • 1
  • 1
0xmtn
  • 2,625
  • 5
  • 27
  • 53
  • 1
    When you try brew install pillow, if it says it's just not linked. Please try this command "brew link pillow", and if this doesn't works try "brew doctor" and "brew update" first and then "brew link pillow". Hope it works. – Prateek Jul 21 '14 at 04:29
  • Thansk for the quick reply @Prateek. Ok I used `brew link pillow`, it said: `Error: Could not symlink bin/pilconvert.py Target /usr/local/bin/pilconvert.py already exists. You may want to remove it: rm /usr/local/bin/pilconvert.py To force the link and overwrite all conflicting files: brew link --overwrite pillow`. But brew install still say it's not linked. So I used `brew link --overwrite pillow`. And it said that 160 symlinks created. But still can't run the django server. – 0xmtn Jul 21 '14 at 04:35
  • When I try to import Image in python shell, it gives the following error: `ImportError: dlopen(/Library/Python/2.7/site-packages/PIL/_imaging.so, 2): Library not loaded: /usr/local/lib/libjpeg.8.dylib Referenced from: /usr/local/lib/libtiff.5.dylib Reason: image not found` – 0xmtn Jul 21 '14 at 04:35
  • Ook, I used brew doctor, and it turned out that jpeg haven't linked. So, after linking it too, I was able to run the server again, finally. Thank you very much Prateek. – 0xmtn Jul 21 '14 at 04:54
  • No issues, happy to help you. – Prateek Jul 21 '14 at 08:50

0 Answers0