当前位置:   article > 正文

brew无法make python2.7.8_brew install python2.7.8

brew install python2.7.8
  • 为安装poppler gem包,使用PDF渲染库,但是遇到以下错误:
  1. Building native extensions. This could take a while...
  2. ERROR: Error installing poppler:
  3. ERROR: Failed to build gem native extension.
  • 查询提示信息原来是,无法调用brew install poppler,单独运行此命令又出现如下错误:
  1. ╰─$ brew install poppler
  2. ==> Installing dependencies for poppler: python, gobject-introspection, libtiff, little-cms2, openjpeg
  3. ==> Installing poppler dependency: python
  4. ==> Downloading https://www.python.org/ftp/python/2.7.8/Python-2.7.8.tgz
  5. Already downloaded: /Library/Caches/Homebrew/python-2.7.8.tgz
  6. ==> Downloading http://bugs.python.org/file30805/issue10910-workaround.txt
  7. Already downloaded: /Library/Caches/Homebrew/python--patch-9926640cb7c8e273e4b451469a2b13d4b9df5ba3.txt
  8. ==> Patching
  9. patching file Include/pyport.h
  10. Hunk #1 succeeded at 713 (offset 14 lines).
  11. Hunk #2 succeeded at 736 (offset 14 lines).
  12. ==> ./configure --prefix=/usr/local/Cellar/python/2.7.8_2 --enable-ipv6 --datarootdir=/usr/local/Cellar/python/2
  13. ==> make
  14. clang -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -IInclude -I./Include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include -DPy_BUILD_CORE -c ./Modules/_sre.c -o Modules/_sre.o
  15. clang -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -IInclude -I./Include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include -DPy_BUILD_CORE -c ./Modules/_codecsmodule.c -o Modules/_codecsmodule.o
  16. 20 errors generated.
  17. make: *** [Python/mactoolboxglue.o] Error 1
  18. make: *** Waiting for unfinished jobs....
  • 按照提示提示,运行brew install python,同样遇到make错误。
  • 经过两天不断思考,google结果未果情况下,尝试将brew下载的包进行手动编译:
  1. # 将安装包解压
  2. cd /Library/Caches/Homebrew/Python-2.7.8
  3. # 需要和brew安装是运行命令一直,可在上面的信息中得到
  4. ./configure --prefix=/usr/local/Cellar/python/2.7.8_2 --enable-ipv6 --datarootdir=/usr/local/Cellar/python/2
  5. make install
  6. # 运行doctor可查看到手动编译会造成未链接警告
  7. brew doctor
  8. # 链接所有python路径
  9. brew link python
  10. # 又提示,某些文件没有权限,直接按照提示使用强制写入
  11. brew link --overwrite --dry-run python
  12. # 现在python以安装完好,运行一下命令可以查看到
  13. brew list
  14. # 现在开始重新安装poppler
  15. brew install poppler
  16. gem install poppler


声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/运维做开发/article/detail/756059
推荐阅读
相关标签
  

闽ICP备14008679号