libpng version incompatibility in fresh installation of IPython

前端 未结 4 767
夕颜
夕颜 2020-12-14 03:06

I used this guide to install the \"scientific stack\" for Python (OSX 10.9.2, brewed Python 2.7.6, IPython 2.0, matplotlib 1.3.1, libpng 1.6.10). Everything was looking good

相关标签:
4条回答
  • 2020-12-14 03:40

    Look for old header files beginning with "png" (png.h, pngconf.h, perhaps others) and remove them.

    0 讨论(0)
  • 2020-12-14 03:46

    An expansion of the answer provided by @glenn-randers-pehrson:

    pip uninstall matplotlib
    cd /opt/X11/include/libpng15
    mv png.h _png.h
    mv pngconf.h _pngconf.h
    mv pnglibconf.h _pnglibconf.h
    pip install matplotlib
    (if needed remove the old directory or use the force option)
    
    (now move the .h files back to their original locations)
    
    0 讨论(0)
  • 2020-12-14 03:50

    While it is a bit ridiculous having multiple copies of libpng around, this problem results from the path for the pip compiler and python being different. You could also fix this problem through the path, and then recompiling, but the above solutions work too.

    0 讨论(0)
  • 2020-12-14 03:52

    For the sake of documentation (following on from above comments):

    Remove X11

    launchctl unload /Library/LaunchAgents/org.macosforge.xquartz.startx.plist
    sudo launchctl unload /Library/LaunchDaemons/org.macosforge.xquartz.privileged_startx.plist
    sudo rm -rf /opt/X11* /Library/Launch*/org.macosforge.xquartz.* /Applications/Utilities/XQuartz.app /etc/*paths.d/*XQuartz
    sudo pkgutil --forget org.macosforge.xquartz.pkg
    

    Then,

    if you have matplotlib / python installed, run the following as appropriate:

    pip uninstall matplotlib
    pip uninstall ipython
    

    Then,

    pip install matplotlib
    pip install ipython
    

    If necessary, XQuartz can be re-installed from https://www.macupdate.com/app/mac/26593/xquartz.

    [Note: This does re-add the /opt/X11/include/libpng15/png.h etc files, but ipython worked fine afterwards.]

    0 讨论(0)
提交回复
热议问题