"ModuleNotFoundError: No module named 'mxrec_pybind'" Is Displayed When Rec SDK TensorFlow Is Used to Run a Recommendation Model

Symptom

The error "ModuleNotFoundError: No module named 'mxrec_pybind'" is displayed when Rec SDK TensorFlow is used to run a recommendation model, indicating that the mxrec_pybind module cannot be found.

Possible Cause

The Rec SDK TensorFlow installation path is not correctly configured in the running script.

Solution

In the running script, add the installation path and .so file path of Rec SDK TensorFlow, and add the .so file path to the environment variable LD_LIBRARY_PATH.

1
2
3
rec_package_path="/usr/local/python3.7.5/lib/python3.7/site-packages/mx_rec"
so_path=${rec_package_path}/libasc
export LD_LIBRARY_PATH=${so_path}:/usr/local/lib:$LD_LIBRARY_PATH