【问题标题】:Install matplotlib to pypy将 matplotlib 安装到 pypy
【发布时间】:2016-06-02 20:46:55
【问题描述】:

当我尝试使用 pip 安装 matplotlib 时,它会抛出异常:

In file included from /usr/include/numpy/ndarrayobject.h:26:0,
                 from src/file_compat.h:7,
                 from src/ft2font_wrapper.cpp:3:
/usr/include/numpy/__multiarray_api.h: In function ‘int _import_array()’:
/usr/include/numpy/__multiarray_api.h:1686:13: error: ‘NPY_CPU_UNKNOWN_ENDIAN’ was not declared in this scope
   if (st == NPY_CPU_UNKNOWN_ENDIAN) {
             ^
/usr/include/numpy/__multiarray_api.h:1697:13: error: ‘NPY_CPU_LITTLE’ was not declared in this scope
   if (st != NPY_CPU_LITTLE) {
             ^
error: command 'cc' failed with exit status 1

----------------------------------------
Command "/usr/bin/pypy -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-vGxrsz/matplotlib/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-oB9gVW-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-vGxrsz/matplotlib

如果我理解正确的话,numpy 中的问题。我使用以下命令安装它:

pypy -m pip install git+https://bitbucket.org/pypy/numpy.git@pypy-4.0.1

我的 numpy 版本是 1.9.0。我的pypy版本:

'2.7.10 (4.0.1+dfsg-1~ppa1~ubuntu15.04, Nov 20 2015, 19:34:27)\n[PyPy 4.0.1 with GCC 4.9.2]'

【问题讨论】:

标签: python numpy matplotlib pip pypy


【解决方案1】:

我安装成功了。 (但并不完美)

pypy7.3.3x64 ubuntu WSL

pypy3 -m pip install matplotlib==2.2

您可能需要安装一些其他软件包。

Why 2.2


为什么选择 ipynb?由于 WSL 上的 GUI 并不那么容易。我设法处理了 CPython && matplotlib (By Xming),但不是 pypy3。


现在最新的是mpl==3.3.1,它可以工作,但有很多警告。

/lib/pypy3/lib_pypy/_functools.py:80: MatplotlibDeprecationWarning: print_svg() got unexpected keyword argument "orientation" which is no longer supported as of 3.3 and will become an error two minor releases later
  return self._func(*(self._args + fargs), **fkeywords)
/lib/pypy3/lib_pypy/_functools.py:80: MatplotlibDeprecationWarning: savefig() got unexpected keyword argument "orientation" which is no longer supported as of 3.3 and will become an error two minor releases later
  return self._func(*(self._args + fargs), **fkeywords)
/lib/pypy3/lib_pypy/_functools.py:80: MatplotlibDeprecationWarning: savefig() got unexpected keyword argument "dpi" which is no longer supported as of 3.3 and will become an error two minor releases later
  return self._func(*(self._args + fargs), **fkeywords)

【讨论】:

    【解决方案2】:

    对我有用的修复:

    sudo apt-get install pypy3-dev

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-07-09
      • 2019-09-16
      • 2021-07-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多