How to add external python libraries as dependencies inside my Rust application? I am getting error while trying to call a function from a python file that uses numpy and scikit-learn #4419
priyas2024
started this conversation in
General
Replies: 1 comment
-
What OS are you using? Might be a duplicate of #1741 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello all,
Inside my rust application I am trying to call a simple function that runs a linear regression model and returns the predictions. This function uses the scikit-learn and numpy functions. I am trying to add the dependencies inside the pyproject.toml and use the maturin build. While running the rust function where the function call is made I am getting the NoModuleError for numpy.
Error: PyErr { type: <class 'ModuleNotFoundError'>, value: ModuleNotFoundError("No module named 'numpy'"), traceback: Some(<traceback object at 0x000001FD12E5D840>) }
error: process didn't exit successfully:
target\debug\rust_python3.exe
(exit code: 1)This is my pyproject.toml
I am following the Pyo3 user guide example where we call an existing function inside a python file.
I am following the below steps to run the application
to install all the dependencies
to build the application
to run the rust application's main.rs from where the call to the python function is made
I don't see any compile time errors. And the build completes without any issues.
Any help would be very much appreciated.
Beta Was this translation helpful? Give feedback.
All reactions