使用brew在macbook上安装wxPython,第一步就遇到了问题:
- maydolly$ sudo brew install wxpython
- ==> Installing dependencies for wxpython: libpng, libtiff, wxmac
- ==> Installing wxpython dependency: libpng
- ==> Downloading https://downloads.sf.net/project/libpng/libpng16/1.6.16/libpng-1
- curl: (6) Could not resolve host: downloads.sf.net
- Error: Failed to download resource “libpng”
- Download failed: https://downloads.sf.net/project/libpng/libpng16/1.6.16/libpng-1.6.16.tar.xz
网上查了下,原来是网站 downloads.sf.net被墙了,无法从那里下到资源,所以在修改brew里面的配置文件。
先找到资源正确地址,把 https://downloads.sf.net/project/libpng/ 网址直接输入浏览器,会自动转到目标网站:
https://sourceforge.net/projects/libpng/files/libpng16
可以看到最新的已经更新到了1.6.29
使用指令:
brew edit libpng
修改配置地址,把原来的
“https://downloads.sf.net/project/libpng/libpng16/1.6.16/libpng-1.6.16.tar.xz”
改为正确的地址:
“https://sourceforge.net/projects/libpng/files/libpng16/1.6.29/libpng-1.6.29.tar.xz”
再次执行指令 brew install wxpython,发现又出现了问题:
- maydolly$ sudo brew install wxpython
- ==> Installing dependencies for wxpython: libpng, libtiff, wxmac
- ==> Installing wxpython dependency: libpng
- ==> Downloading https://sourceforge.net/projects/libpng/files/libpng16/1.6.29/li
- ######################################################################## 100.0%
- Error: SHA1 mismatch
- Expected: 31855a8438ae795d249574b0da15b34eb0922e13
- Actual: 7dbe6a5088b938545fc0857c507d4e0cf5d9023e
- Archive: /Library/Caches/Homebrew/libpng-1.6.29.tar.xz
- To retry an incomplete download, remove the file above.
原来是SHA1码不符合,把Actual码复制下来,再次编辑 libpng,把里面的改成新的,再次执行brew install wxpython.