
Hi, all May I know the numpy status for PyPy? Can it be run with PyPy? I git clone the source code from https://bitbucket.org/pypy/numpy.git, but seems it's not been maintained for several years. And what's the difference from the numpy for CPython(https://github.com/numpy/numpy)? Any specific modifications? Thanks.

On 8/5/20 11:07 AM, Huang, Yang wrote:
Don't use that. Use pypy3 -mensurepip pypy3 -pip install numpy If you are on linux64, this will install a binary wheel just as on CPython. If you are on win32, you will need to wait a bit for the binary wheel; it should appear soon. For more information, see https://doc.pypy.org/en/latest/faq.html#what-about-numpy-numpypy-micronumpy Matti

https://bitbucket.org/pypy/numpy.git It's numpypy, which is not maintained yet. "pypy3 -mpip install numpy", Does this cmd install the numpy (https://github.com/numpy/numpy) ? Does the same numpy support both Cpython and pypy ?

On 8/5/20 3:46 PM, Huang, Yang wrote:
Did you read the link I pointed to? If something is not clear with the information there or you have an idea how to make it more prominent then it should be fixed there via filing an issue at https://foss.heptapod.net/pypy/pypy/-/issues Matti

Yes, I did. Thank you. But 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.
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'

On 8/5/20 4:48 PM, Huang, Yang wrote:
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

On 8/5/20 11:07 AM, Huang, Yang wrote:
Don't use that. Use pypy3 -mensurepip pypy3 -pip install numpy If you are on linux64, this will install a binary wheel just as on CPython. If you are on win32, you will need to wait a bit for the binary wheel; it should appear soon. For more information, see https://doc.pypy.org/en/latest/faq.html#what-about-numpy-numpypy-micronumpy Matti

https://bitbucket.org/pypy/numpy.git It's numpypy, which is not maintained yet. "pypy3 -mpip install numpy", Does this cmd install the numpy (https://github.com/numpy/numpy) ? Does the same numpy support both Cpython and pypy ?

On 8/5/20 3:46 PM, Huang, Yang wrote:
Did you read the link I pointed to? If something is not clear with the information there or you have an idea how to make it more prominent then it should be fixed there via filing an issue at https://foss.heptapod.net/pypy/pypy/-/issues Matti

Yes, I did. Thank you. But 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.
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'

On 8/5/20 4:48 PM, Huang, Yang wrote:
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
participants (2)
-
Huang, Yang
-
Matti Picus