langgenius / dify-sandbox

A lightweight, fast, and secure code execution environment that supports multiple programming languages
https://docs.dify.ai/development/backend/sandbox
Apache License 2.0
434 stars 97 forks source link

error when import numpy (version 2.0.4) #38

Closed lzzzzzzzzz closed 3 months ago

lzzzzzzzzz commented 3 months ago

libstdc++.so.6 is already added in config.yaml, it seems like some action show be prepare before import numpy?

node log as follow

Node 代码执行 6 run failed: py/init.py", line 119, in raise ImportError(msg) from e 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. ubleshooting tips at: https://numpy.org/devdocs/user/troubleshooting-importerror.html Please note and check the following: The Python version is: Python3.10 from "/usr/local/bin/python3" The NumPy version is: "2.0.1" and make sure that they are the versions you expect. Please carefully study the documentation linked above for further help. Original error was: libstdc++.so.6: cannot open shared object file: No such file or directory The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/var/sandbox/sandbox-python/tmp/e06088a0_edfb_410b_bb8a_ccc40d8bd46b.py", line 48, in File "", line 3, in File "/usr/local/lib/python3.10/site-packages/numpy/init.py", line 119, in raise ImportError(msg) from e 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. ubleshooting tips at: https://numpy.org/devdocs/user/troubleshooting-importerror.html Please note and check the following: The Python version is: Python3.10 from "/usr/local/bin/python3" The NumPy version is: "2.0.1" and make sure that they are the versions you expect. Please carefully study the documentation linked above for further help. Original error was: libstdc++.so.6: cannot open shared object file: No such file or directory The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/var/sandbox/sandbox-python/tmp/e06088a0_edfb_410b_bb8a_ccc40d8bd46b.py", line 48, in File "", line 3, in File "/usr/local/lib/python3.10/site-packages/numpy/init.py", line 119, in raise ImportError(msg) from e 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. error: exit status 255

lzzzzzzzzz commented 3 months ago

chage numpy==1.24.1 and add - /usr/lib/x86_64-linux-gnu/libgcc_s.so.1 in config.yaml it work