Matplotlib 最近有 released a python 3 compatible version 。要安装 matplotlib,您需要 numpy。
我按照说明进行操作 here用于安装 matplotlib。我尝试根据 instructions for Mac OS Lion 10.7 here 安装 numpy (希望它可能足够相似),但是终端卡在第一个命令处:
$curl http://python-distribute.org/distribute_setup.py | python3
dyld: Library not loaded: @rpath/libcurl.4.dylib
Referenced from: /Library/Frameworks/Python.framework/Versions/Current/bin/curl
Reason: Incompatible library version: curl requires version 7.0.0 or later, but libcurl.4.dylib provides version 6.0.0
第二个相同(如预期):
$ curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py | python3
dyld: Library not loaded: @rpath/libcurl.4.dylib
Referenced from: /Library/Frameworks/Python.framework/Versions/Current/bin/curl
Reason: Incompatible library version: curl requires version 7.0.0 or later, but libcurl.4.dylib provides version 6.0.0
关于如何修复 curl 错误有什么想法吗?
最佳答案
来自this post ,我找到了更新curl的说明。
但我担心下载 Mac 安全版本,所以我访问 this page ,向下滚动到 Mac 部分,然后在 Apple 网站上选择一个。
最后我决定安装这个版本作为附加curl(即不替换系统curl),所以这里是修改后的说明:
- 下载curl源代码(链接#2)
- 在某处解压 zip 文件
- 打开终端窗口并转到包含curl源的目录
- 类型:
$CFLAGS=-m64 ./configure --prefix=
路径名
- 类型:
$make
- 类型:
$sudo make install
要运行它,请 cd 进入路径名/bin/目录,然后运行:
$ ./curl URL_OF_DOWNLOAD | python3
关于在 Mac OS X 10.6 上安装适用于 Python 3 的 numpy 和 matplotlib 时出现 Curl 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11390039/