Python modules in configuration not found

Hello Everyone!

I’m having a strange issue, that really bugs me.
I’m simply trying to include some python modules in the Pipeline Configuration. I placed them in a folder inside the config, and in the bootstrap hook I sys.path.append('modules_folder').
In the next step, in the pipeline_configuration_ini hook I’d like to simply import and use those python modules, however they are not found, I get DLL load failed: The specified module could not be found.
I tried a lot of variations here, even added the modules’ folder to the system environment variables (PATH and PYTHONPATH too), nothing works, the modules can not be imported.

What am I missing here? Is there a different way to do this?

Thanks in advance for your wisdom!

Hi @pw_simon !

I can only guess here, but are trying to load a python Library that contains binary modules? Common examples would be numpy or pillow. These can make problems if they are used in applications that were compiled with a different compiler version. Maya used to be a good example for that. I think you had to compile your own version of numpy or pillow for all versions prior to 2020.
Point is: only .py and .pyc files are truly compatible across different compiled versions of python, .pyd files are not.

Hope that helps! :slight_smile:

Hello @Fabian !

That is exactly what the problem was! After reinstalled the modules with the same python version’s pip as the config’s python and placed them in my folder, everything worked as expected.

Accept my sincere gratitude! :slight_smile:

1 Like