在 CentOS 6.5 上安装 Matplotlib

2023-12-10

我正在尝试使用 Python 2.7.8 在 CentOS 6.5 上安装 matplotlib-1.4.0。我尝试过使用 pip 和从源代码安装。我最初收到一条错误消息,指出我需要更新版本的 Freetype2,然后我将其安装(版本 2.5.3)到 /usr/local/bin、/usr/local/include 和 /usr/local/lib。旧版本的 Freetype2 (2.3.11) 位于 /usr/bin、/usr/include/freetype2/freetype 和 /usr/lib 中。

现在,当我尝试安装 matplotlib (python setup.py build) 时,看起来包含路径都指向错误的(旧)版本的 Freetype2,并且我不知道如何更改适当的路径以指向较新的版本Freetype2 版本。实际的错误消息如下,而且非常混乱。我在网上找不到太多关于他的错误的信息,但我可以看到错误的 Freetype2 路径,所以我猜测这就是导致问题的原因。有小费吗?

在其他线程上找到有关添加 /usr/include/freetype 符号链接以指向 /usr/local/include/freetype2 的提示,但这没有帮助。

building 'matplotlib.ft2font' extension
gcc -pthread -fno-strict-aliasing -O3 -m64 -mfpmath=sse -msse2 -mtune=generic -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib_ft2font_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/usr/local/python2/2.7.8/x86_64/gcc46/nonet/lib/python2.7/site-packages/numpy/core/include -I/usr/include/freetype2 -I/usr/local/include -I/usr/include -I. -Iextern -I/usr/local/python2/2.7.8/x86_64/gcc46/nonet/include/python2.7 -c src/ft2font.cpp -o build/temp.linux-x86_64-2.7/src/ft2font.o
In file included from /usr/local/python2/2.7.8/x86_64/gcc46/nonet/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1761:0,
                 from /usr/local/python2/2.7.8/x86_64/gcc46/nonet/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17,
                 from src/file_compat.h:7,
                 from src/ft2font.cpp:7:
/usr/local/python2/2.7.8/x86_64/gcc46/nonet/lib/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
In file included from src/ft2font.cpp:7:0:
src/file_compat.h:31:0: warning: "npy_fseek" redefined [enabled by default]
/usr/local/python2/2.7.8/x86_64/gcc46/nonet/lib/python2.7/site-packages/numpy/core/include/numpy/npy_common.h:86:0: note: this is the location of the previous definition
src/file_compat.h:32:0: warning: "npy_ftell" redefined [enabled by default]
/usr/local/python2/2.7.8/x86_64/gcc46/nonet/lib/python2.7/site-packages/numpy/core/include/numpy/npy_common.h:91:0: note: this is the location of the previous definition
src/ft2font.cpp: In member function ‘Py::Object FT2Image::py_write_bitmap(const Py::Tuple&)’:
src/ft2font.cpp:184:15: warning: unused variable ‘offset’ [-Wunused-variable]
gcc -pthread -fno-strict-aliasing -O3 -m64 -mfpmath=sse -msse2 -mtune=generic -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib_ft2font_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/usr/local/python2/2.7.8/x86_64/gcc46/nonet/lib/python2.7/site-packages/numpy/core/include -I/usr/include/freetype2 -I/usr/local/include -I/usr/include -I. -Iextern -I/usr/local/python2/2.7.8/x86_64/gcc46/nonet/include/python2.7 -c src/mplutils.cpp -o build/temp.linux-x86_64-2.7/src/mplutils.o
In file included from /usr/local/python2/2.7.8/x86_64/gcc46/nonet/include/python2.7/Python.h:8:0,
                 from src/mplutils.h:18,
                 from src/mplutils.cpp:6:
/usr/local/python2/2.7.8/x86_64/gcc46/nonet/include/python2.7/pyconfig.h:1182:0: warning: "_POSIX_C_SOURCE" redefined [enabled by default]
/usr/include/features.h:162:0: note: this is the location of the previous definition
/usr/local/python2/2.7.8/x86_64/gcc46/nonet/include/python2.7/pyconfig.h:1204:0: warning: "_XOPEN_SOURCE" redefined [enabled by default]
/usr/include/features.h:164:0: note: this is the location of the previous definition
gcc -pthread -fno-strict-aliasing -O3 -m64 -mfpmath=sse -msse2 -mtune=generic -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib_ft2font_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/usr/local/python2/2.7.8/x86_64/gcc46/nonet/lib/python2.7/site-packages/numpy/core/include -I/usr/include/freetype2 -I/usr/local/include -I/usr/include -I. -Iextern -I/usr/local/python2/2.7.8/x86_64/gcc46/nonet/include/python2.7 -c extern/CXX/cxxsupport.cxx -o build/temp.linux-x86_64-2.7/extern/CXX/cxxsupport.o
gcc -pthread -fno-strict-aliasing -O3 -m64 -mfpmath=sse -msse2 -mtune=generic -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib_ft2font_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/usr/local/python2/2.7.8/x86_64/gcc46/nonet/lib/python2.7/site-packages/numpy/core/include -I/usr/include/freetype2 -I/usr/local/include -I/usr/include -I. -Iextern -I/usr/local/python2/2.7.8/x86_64/gcc46/nonet/include/python2.7 -c extern/CXX/cxx_extensions.cxx -o build/temp.linux-x86_64-2.7/extern/CXX/cxx_extensions.o
gcc -pthread -fno-strict-aliasing -O3 -m64 -mfpmath=sse -msse2 -mtune=generic -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib_ft2font_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/usr/local/python2/2.7.8/x86_64/gcc46/nonet/lib/python2.7/site-packages/numpy/core/include -I/usr/include/freetype2 -I/usr/local/include -I/usr/include -I. -Iextern -I/usr/local/python2/2.7.8/x86_64/gcc46/nonet/include/python2.7 -c extern/CXX/IndirectPythonInterface.cxx -o build/temp.linux-x86_64-2.7/extern/CXX/IndirectPythonInterface.o
gcc -pthread -fno-strict-aliasing -O3 -m64 -mfpmath=sse -msse2 -mtune=generic -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib_ft2font_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/usr/local/python2/2.7.8/x86_64/gcc46/nonet/lib/python2.7/site-packages/numpy/core/include -I/usr/include/freetype2 -I/usr/local/include -I/usr/include -I. -Iextern -I/usr/local/python2/2.7.8/x86_64/gcc46/nonet/include/python2.7 -c extern/CXX/cxxextensions.c -o build/temp.linux-x86_64-2.7/extern/CXX/cxxextensions.o
g++ -pthread -shared build/temp.linux-x86_64-2.7/src/ft2font.o build/temp.linux-x86_64-2.7/src/mplutils.o build/temp.linux-x86_64-2.7/extern/CXX/cxxsupport.o build/temp.linux-x86_64-2.7/extern/CXX/cxx_extensions.o build/temp.linux-x86_64-2.7/extern/CXX/IndirectPythonInterface.o build/temp.linux-x86_64-2.7/extern/CXX/cxxextensions.o -L/usr/local/lib -L/usr/local/lib64 -L/usr/lib -L/usr/lib64 -L/usr/local/python2/2.7.8/x86_64/gcc46/nonet/lib -lfreetype -lstdc++ -lm -lpython2.7 -o build/lib.linux-x86_64-2.7/matplotlib/ft2font.so
/usr/bin/ld: /usr/local/lib/libpython2.7.a(abstract.o): relocation R_X86_64_32S against `_Py_NotImplementedStruct' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libpython2.7.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
error: command 'g++' failed with exit status 1  

虽然我使用的是 python-2.6,但我只是解决了完全相同的 freetype 错误:本质上,您可以简单地下载 matplotlib python 存档并将 freetype-2.4 的要求编辑为 freetype-2.3。这一切都是在 virtualenv 中自然完成的。

  1. 获取当前最新 matplotlib 的副本

    pip install --download 。 matplotlib==1.4.0

  2. 解压结果 tar -xzvf matplotlib-1.4.0.tar.gz

  3. 将 freetype 的明确要求从 2.4 编辑到 2.3(第 945 行)

    vi matplotlib-1.4.0/setupext.py

    min_version='2.4', 版本=版本)

  4. 重新创建存档

    tar -czvf matplotlib-1.4.0.tar.gz

  5. 安装要求

    pip安装numpy

    pip 安装 geojson==1.0.6

  6. 安装修改后的本地存档,并观察它的编译过程

    pip install --verbose matplotlib-1.4.0.tar.gz

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

在 CentOS 6.5 上安装 Matplotlib 的相关文章

随机推荐

  • jQuery,按属性值选择,添加新属性

    我的 HTML 中有一个锚点 它有一个带有值的页面属性 因此 每次单击它时 我都会在 js 中使用页面属性值 现在我想设置一个带有背景颜色的样式属性来显示某个元素被选中 因此 我必须按页面属性选择元素 并向 a 元素添加一个带有值的新属性
  • 在 @FetchRequest 中输入一个动态值,以从 SwiftUI 中的核心数据中获取单个实体

    我在这里看到了相同类型的错误 但使用了不同类型的代码 所以我认为最好就此上下文提出一个新问题 我试图通过尝试传递一个字符串变量 用作查找该实体的键 来从核心数据中 查找特定实体 title into FetchRequest 这是我使用过的
  • BulkInsertCommand 在 Sync Framework 2.1 中失败

    有时 当我尝试使用 Sync Framework 2 1 从 SQL Express 同步到 SQL Server 时 会收到以下错误 一旦客户端收到此错误 他们必须重新初始化作用域 语法不会有任何问题 比如错误状态 因为它在很长一段时间内
  • 发布同名nuget包时在.net vNext中引用本地项目

    我正在尝试在 VS 2015 中使用新的 vNext 项目类型构建一个包 我想在同一解决方案 不是 vNext 中引用一个项目 但它试图为该项目找到一个 nuget 包 而不是直接引用它 我究竟做错了什么 version 1 0 0 dep
  • 在 Dreamweaver CS 5.5 中设置 codeigniter

    我正在寻找有关如何在 Dreamweaver CS 5 5 中设置代码点火器项目的信息 并像 Zend 框架一样使用代码提示 我成功地在 Dreamweaver CS5 5 中设置了 code igniter 方法是下载最新版本的 code
  • 使用 Python 3.6 抓取 Duckduckgo

    一个简单的问题 我可以从 duckduckgo 搜索的第一页抓取结果 然而 我正在努力进入第二页和后续页面 我已将 Python 与 Selenium Webdriver 结合使用 这对于首页结果来说效果很好 我用来抓取第一页的代码是 re
  • iPhone6(无显示缩放模式)UIMenuController 被截断

    我有一个问题UIMenuController在我的 iPhone 6 上 当我使用标准显示模式并且设备处于横向模式时 在 iPhone 6 Plus 上 两种模式都会出现问题 也许这取决于屏幕分辨率 在这种情况下 UIMenuControl
  • Keras 后端 - ImportError:无法导入名称 ctc_ops

    我已经安装了 keras 但是当我编写 import keras 时 出现错误 导入错误 无法导入名称 ctc ops 我想将后端从张量流更改为 theano 但找不到此处提到的 keras json https keras io back
  • 通过在彼此之间嵌套子查询来解决 MySQL 中 61 个表 JOIN 的限制

    我发现你可以通过使用子查询来绕过 MySQL 中 61 个表连接的限制 https stackoverflow com a 20134402 2843690 我正在想办法easily在我正在开发的程序中使用它来从 Magento 获取详细的
  • 将调试信息嵌入到构建中不包含任何调试符号

    在我的项目中 在 构建 高级 部分中 我设置了 调试信息 嵌入 另外 我还设置了一个选项将我的项目打包为 nupkg 文件 由于项目已构建 因此创建了一个 nupkg 文件 但是当我在调试另一个项目时使用此 nupkg 文件时 不包含任何符
  • 序列与同一性

    SQL Server 2012 推出Sequence作为一项新功能 与 Oracle 和 Postgres 中的相同 在哪些情况下序列优先于身份 为什么我们需要序列 我想你会找到你的答案here 使用列的标识属性 您可以轻松生成 自动递增数
  • MVC(ASP.NET MVC)带3层架构如何协同工作?

    我正在编写一个设计文档 我的团队中的人员愿意从 ASP NET WebForm 迁移到 ASP NET MVC 这很棒 但我很难理解 MVC 如何在 3 层 数据层 业务层和表示层 架构中工作 我们可以说模型 视图和控制器是表示层的一部分吗
  • 绝对导入包中的 python ModuleNotFoundError 错误?

    我有这样的文件结构 E test M2 demo py MA MA1 init py ma1 py init py ma1 py def foo print I am here demo py from MA MA1 ma1 import
  • 动态地将不同尺寸的并排图像调整为相同的高度

    我在块级容器中有两个并排的图像 尺寸任意不同 例如 它们可以是任意两个图像 我想动态调整其宽度 以便两个图像的总高度是相同的 我不think从我所见过的一切中 这都可以在 CSS 中完成 虽然可能使用 Flexbox 模型 但我对此了解不够
  • 会话刷新后,我仍然可以访问 Sitecore 联系面吗?

    我希望我没有搞错 一如既往 sitecore 文档很糟糕 我想要一种针对访问者存储信息的方法 我对 sitecore 相当陌生 但是接触面似乎是理想的解决方案 几乎从上面的链接中逐字逐句地实现了 直到它投入生产 我对此非常满意 当我存储信息
  • WCF 中的信息重用

    在阅读 SOA 文章时 我发现了一篇文章http www ibm com developerworks websphere library techarticles 0806 boughannam 0806 boughannam html
  • 在 LESS 中改变多个相似元素的颜色最有效的方法是什么?

    我有一个收藏li 每个都有不同的背景颜色 如下所示 menu white background color product white color darken product white 20 menu green background
  • 检查 mysqli_query 是否返回任何值?

    我有以下代码 我想知道是否mysqli query返回任何行 如果是则返回错误 result mysqli query connection SELECT FROM users if result echo No records found
  • Delphi + iOS:如何声明简单的 ObjC 类?

    如何在 Delphi Firemonkey XE5 或 XE6 中声明一个简单的 ObjC 类 我想创建一个动画委托类 并在该类中包含一些委托方法 Thanks 使用您的方法创建一个接口并从 IObjectiveC 派生 还要创建一个指南
  • 在 CentOS 6.5 上安装 Matplotlib

    我正在尝试使用 Python 2 7 8 在 CentOS 6 5 上安装 matplotlib 1 4 0 我尝试过使用 pip 和从源代码安装 我最初收到一条错误消息 指出我需要更新版本的 Freetype2 然后我将其安装 版本 2