在 Mac OS X 10.6 上安装适用于 Python 3 的 numpy 和 matplotlib 时出现 Curl 错误

标签 curl numpy python-3.x matplotlib libcurl

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),所以这里是修改后的说明:

  1. 下载curl源代码(链接#2)
  2. 在某处解压 zip 文件
  3. 打开终端窗口并转到包含curl源的目录
  4. 类型:$CFLAGS=-m64 ./configure --prefix=路径名
  5. 类型:$make
  6. 类型:$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/

相关文章:

具有并行 curl 操作的 Bash 脚本

PHP curl 错误 : SSL certificate problem: unable to get local issuer certificate

python - 我在 pycharm 中导入 nmap 时遇到问题

python - 迭代 numpy 数组列表

python - 如何在Excel中使用python将列拆分为父列下的两个子列

python-3.x - 如何只获得正分?

python - 在python3中优雅地退出多进程

linux - 简单的 Bash 脚本不工作

java - 如何在Java中使用cURL?

python - 使用 Eigen 库在 C++ 中计算多项式的根