免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3909 | 回复: 3
打印 上一主题 下一主题

安装matspotlib报错 [复制链接]

论坛徽章:
6
IT运维版块每日发帖之星
日期:2015-09-05 06:20:00IT运维版块每日发帖之星
日期:2015-09-06 06:20:00IT运维版块每日发帖之星
日期:2015-10-17 06:20:00IT运维版块每周发帖之星
日期:2015-11-06 19:28:13IT运维版块每日发帖之星
日期:2015-11-07 06:20:00操作系统版块每周发帖之星
日期:2015-12-02 15:01:04
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2015-10-22 22:15 |只看该作者 |倒序浏览
环境是redhat6.2 64位,python2.7.5
直接通过pip install matsplotlib,报错如下:(我尝试使用源码通过python setup.py install安装也报同样的错误)
Edit setup.cfg to change the build options

BUILDING MATPLOTLIB
            matplotlib: yes [1.4.3]
                python: yes [2.7.5 (default, Oct 22 2015, 03:35:23)  [GCC
                        4.4.6 20110731 (Red Hat 4.4.6-3)]]
              platform: yes [linux2]

REQUIRED DEPENDENCIES AND EXTENSIONS
                 numpy: yes [version 1.10.1]
                   six: yes [using six version 1.10.0]
              dateutil: yes [using dateutil version 2.4.2]
                  pytz: yes [using pytz version 2015.6]
               tornado: yes [tornado was not found. It is required for the
                        WebAgg backend. pip/easy_install may attempt to
                        install it after matplotlib.]
             pyparsing: yes [using pyparsing version 2.0.3]
                 pycxx: yes [Couldn't import.  Using local copy.]
                libagg: yes [pkg-config information for 'libagg' could not
                        be found. Using local copy.]
              freetype: yes [version 2.6.0]
                   png: yes [version 1.6.18]
                 qhull: yes [pkg-config information for 'qhull' could not be
                        found. Using local copy.]

OPTIONAL SUBPACKAGES
           sample_data: yes [installing]
              toolkits: yes [installing]
Traceback (most recent call last):
  File "setup.py", line 155, in <module>
    result = package.check()
  File "/tmp/matplotlib-1.4.3/setupext.py", line 666, in check
    import mock
  File "/usr/local/lib/python2.7/site-packages/mock/__init__.py", line 2, in <module>
    import mock.mock as _mock
  File "/usr/local/lib/python2.7/site-packages/mock/mock.py", line 71, in <module>
    _v = VersionInfo('mock').semantic_version()
  File "/usr/local/lib/python2.7/site-packages/pbr/version.py", line 452, in semantic_version
    self._semantic = self._get_version_from_pkg_resources()
  File "/usr/local/lib/python2.7/site-packages/pbr/version.py", line 439, in _get_version_from_pkg_resources
    result_string = packaging.get_version(self.package)
  File "/usr/local/lib/python2.7/site-packages/pbr/packaging.py", line 668, in get_version
    raise Exception("Versioning for this project requires either an sdist"
Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository. Are you sure that git is installed?

有兄弟遇到类似问题么?怎么解决的啊?望告知,多谢

论坛徽章:
6
IT运维版块每日发帖之星
日期:2015-09-05 06:20:00IT运维版块每日发帖之星
日期:2015-09-06 06:20:00IT运维版块每日发帖之星
日期:2015-10-17 06:20:00IT运维版块每周发帖之星
日期:2015-11-06 19:28:13IT运维版块每日发帖之星
日期:2015-11-07 06:20:00操作系统版块每周发帖之星
日期:2015-12-02 15:01:04
2 [报告]
发表于 2015-10-23 14:55 |只看该作者
该问题已经解决了,我把我本机windows环境上python2.7下site-package所有文件upload到redhat环境中,再安装就顺利完成了,但是执行命令时报了另外一个错误:
IPython 4.0.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.
[TerminalIPythonApp] WARNING | Eventloop or matplotlib integration failed. Is matplotlib installed?
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
/usr/local/lib/python2.7/site-packages/IPython/core/shellapp.pyc in <lambda>(key)
    217         shell = self.shell
    218         if self.pylab:
--> 219             enable = lambda key: shell.enable_pylab(key, import_all=self.pylab_import_all)
    220             key = self.pylab
    221         elif self.matplotlib:

/usr/local/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in enable_pylab(self, gui, import_all, welcome_message)
   3169         from IPython.core.pylabtools import import_pylab
   3170         
-> 3171         gui, backend = self.enable_matplotlib(gui)
   3172         
   3173         # We want to prevent the loading of pylab to pollute the user's

/usr/local/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in enable_matplotlib(self, gui)
   3130                 gui, backend = pt.find_gui_and_backend(self.pylab_gui_select)
   3131         
-> 3132         pt.activate_matplotlib(backend)
   3133         pt.configure_inline_support(self, backend)
   3134         

/usr/local/lib/python2.7/site-packages/IPython/core/pylabtools.pyc in activate_matplotlib(backend)
    272     matplotlib.rcParams['backend'] = backend
    273
--> 274     import matplotlib.pyplot
    275     matplotlib.pyplot.switch_backend(backend)
    276

/usr/local/lib/python2.7/site-packages/matplotlib/pyplot.py in <module>()
     25
     26 import matplotlib
---> 27 import matplotlib.colorbar
     28 from matplotlib import style
     29 from matplotlib import _pylab_helpers, interactive

/usr/local/lib/python2.7/site-packages/matplotlib/colorbar.py in <module>()
     32 import matplotlib.artist as martist
     33 import matplotlib.cbook as cbook
---> 34 import matplotlib.collections as collections
     35 import matplotlib.colors as colors
     36 import matplotlib.contour as contour

/usr/local/lib/python2.7/site-packages/matplotlib/collections.py in <module>()
     25 import matplotlib.artist as artist
     26 from matplotlib.artist import allow_rasterization
---> 27 import matplotlib.backend_bases as backend_bases
     28 import matplotlib.path as mpath
     29 from matplotlib import _path

/usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.py in <module>()
     54
     55 import matplotlib.tight_bbox as tight_bbox
---> 56 import matplotlib.textpath as textpath
     57 from matplotlib.path import Path
     58 from matplotlib.cbook import mplDeprecation

/usr/local/lib/python2.7/site-packages/matplotlib/textpath.py in <module>()
     20 from matplotlib.ft2font import FT2Font, KERNING_DEFAULT, LOAD_NO_HINTING
     21 from matplotlib.ft2font import LOAD_TARGET_LIGHT
---> 22 from matplotlib.mathtext import MathTextParser
     23 import matplotlib.dviread as dviread
     24 from matplotlib.font_manager import FontProperties

/usr/local/lib/python2.7/site-packages/matplotlib/mathtext.py in <module>()
     61
     62 import matplotlib.colors as mcolors
---> 63 import matplotlib._png as _png
     64 ####################
     65

ImportError: libpng16.so.16: cannot open shared object file: No such file or directory

我核查了一下环境,libpng已经安装了(通过源码编译安装的),且该文件存在
[root@master /]# find . -name "libpng16.so.16"
./tmp/libpng-1.6.18/.libs/libpng16.so.16
./usr/local/lib/libpng16.so.16

是因为lib的路径配置有问题么?

论坛徽章:
4
白羊座
日期:2013-11-05 10:26:09冥斗士
日期:2015-11-17 14:19:55白银圣斗士
日期:2015-11-17 15:13:0815-16赛季CBA联赛之新疆
日期:2016-04-01 09:10:58
3 [报告]
发表于 2015-10-23 16:22 |只看该作者
可以先查看下 sys.path 有哪些。

论坛徽章:
6
IT运维版块每日发帖之星
日期:2015-09-05 06:20:00IT运维版块每日发帖之星
日期:2015-09-06 06:20:00IT运维版块每日发帖之星
日期:2015-10-17 06:20:00IT运维版块每周发帖之星
日期:2015-11-06 19:28:13IT运维版块每日发帖之星
日期:2015-11-07 06:20:00操作系统版块每周发帖之星
日期:2015-12-02 15:01:04
4 [报告]
发表于 2015-10-23 18:52 |只看该作者
sys.path不包含这个路径,我设置了PYTHONPATH环境变量后,再运行IPYTHON=1 IPYTHON_OPTS="--pylab" ./bin/pyspark依然报同样的错误,唉
进去shell里面再check变量,值已经添加了
In [1]: import sys

In [2]: sys.path
Out[2]:
[u'/tmp/spark-35a3e7c8-ccc3-4e8b-879e-ff43bda78edf/userFiles-bfc72768-1945-4233-985c-342cf9dca7bd',
'',
'/usr/local/bin',
'/usr/local/lib/python2.7/site-packages/python_ping-0.0.0-py2.7.egg',
'/tmp/spark-1.5.0-bin-hadoop2.6/python/lib/py4j-0.8.2.1-src.zip',
'/tmp/spark-1.5.0-bin-hadoop2.6/python',
'/tmp/spark-1.5.0-bin-hadoop2.6',
'/usr/local/lib/python27.zip',
'/usr/local/lib/python2.7',
'/usr/local/lib/python2.7/plat-linux2',
'/usr/local/lib/python2.7/lib-tk',
'/usr/local/lib/python2.7/lib-old',
'/usr/local/lib/python2.7/lib-dynload',
'/usr/local/lib/python2.7/site-packages',
'/usr/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg',
'/usr/local/lib/python2.7/site-packages/wx-3.0-msw',
'/usr/local/lib/python2.7/site-packages/IPython/extensions',
'/root/.ipython']
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP