Pypy 有一个 numpy 的分支。如何在pypy沙箱中使用?
沙盒提示'No module named numpy'。
但是,当我试图复制 lib_pypy 目录中的 numpy 库时,我收到了这个错误信息。有没有办法在 pypy sandbox 中导入 numpy?
import numpyTraceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/bin/lib_pypy/numpy/__init__.py", line 160, in <module>
raise ImportError(msg)
ImportError: Error importing numpy: you should not try to import numpy from
its source directory; please exit the numpy source tree, and relaunch
your python interpreter from there.
最佳答案
抱歉,您根本无法在沙盒 PyPy 中导入 numpy。
几乎所有扩展模块都是这种情况。 PyPy 中的沙盒是一个很好的概念证明,恕我直言,它确实很安全,但这只是一个概念证明。它非常需要有人来处理它。在此之前,它只能用于“玩具”示例:几乎不导入任何内容(或仅递归地仅导入纯 Python 模块)的程序。
关于python - 如何在pypy沙箱中导入numpy,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31215545/