On 8/5/20 4:48 PM, Huang, Yang wrote:
...after I install numpy for pypy, there are some errors. Not sure anybody met before:

Python 3.6.9 (2ad108f17bdb, Apr 07 2020, 02:59:05)
[PyPy 7.3.1 with GCC 7.3.1 20180303 (Red Hat 7.3.1-5)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
   File "/home/hy/ai/python/numpy/numpy/core/__init__.py", line 22, in <module>
     from . import multiarray
   File "/home/hy/ai/python/numpy/numpy/core/multiarray.py", line 12, in 
<module>
     from . import overrides
   File "/home/hy/ai/python/numpy/numpy/core/overrides.py", line 7, in <module>
     from numpy.core._multiarray_umath import (
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/home/hy/ai/python/numpy/numpy/__init__.py", line 145, in <module>
     from . import core
   File "/home/hy/ai/python/numpy/numpy/core/__init__.py", line 48, in <module>
     raise ImportError(msg)
ImportError:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.

We have compiled some common reasons and troubleshooting tips at:

     https://numpy.org/devdocs/user/troubleshooting-importerror.html

Please note and check the following:

   * The Python version is: Python3.6 from "/snap/pypy3/57/bin/pypy3"
   * The NumPy version is: "1.20.0.dev0+e7c1d01"

and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.

Original error was: No module named 'numpy.core._multiarray_umath'

Thanks for the specific question.

This is a problem with the snap install of PyPy and has been reported on the NumPy issue tracker:

https://github.com/numpy/numpy/issues/16111


Note you end up trying to use CPython's numpy, which will not work. (from /home/hy/a/python/numpy/numpy)

I would advise you use conda since they nicely package many binary wheels: scipy, matplotlib, pandas, numpy and more.

https://conda-forge.org/blog/posts/2020-03-10-pypy/


It will not be fast but it should work.

Matti

_______________________________________________
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev

Reply via email to