python - 如何在pypy沙箱中导入numpy

标签 python numpy sandbox pypy

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/

相关文章:

python -/lib64/libc.so.6 : version `GLIBC_2.14' not found - error from the application build using pyinstaller

javascript - 如何在服务器上运行浏览器功能?

Python 子进程 : why won't the list of arguments work analogous to the full shell string?

python - 一般维数的多维网格

python - 与 numpy 并行初始化矩阵

python - 将列表转换为 numpy 数组而不使用太多 RAM

xcode - 当应用程序被沙箱化时,CGEvent 不起作用

python - 这是我当前写入文件的方式。但是,我不能做UTF-8?

php - 如何防止用户操纵文件系统

security - 是否有一种基于 LLVM 的编程语言可以保证沙箱安全的快速二进制文件?