I have a workflow which calls Workspaces from a python script (Python 3.7.2 running in Spyder).
Because of an issue/bug I encountered, I was advised to install the newest version of FME and see if the problem persists. Now I cannot get my scripts to work again.
This works:
sys.path.append("C:\\Program Files\\FME\\fmeobjects\\python37")
import fmeobjects
(...)
runner = fmeobjects.FMEWorkspaceRunner()
(...)
runner.runWithParameters(ws, parameters)
(...)
This doesn't:
sys.path.append("C:\\Program Files\\FME2022_2_3\\fmeobjects\\python37")
import fmeobjects
(...)
runner = fmeobjects.FMEWorkspaceRunner()
(...)
runner.runWithParameters(ws, parameters)
All I did was change the path from the old installation to the new one.
It fails, saying the module is not found
File "c:/data/data.py", line 24, in <module>
import fmeobjects
ImportError: DLL load failed: The specified module could not be found.
It seems it actually finds "fmeobjects", but something else is missing. I suspect some underlying environment setting is the issue, but I can't resolve it. Neither PATH nor PYTHONPATH had any link to the old FME installation, so I don't know where to start. Old version is 2021.1.2, new is 2022.2.3.
All I could figure out, was that I need to remove the old directory from sys.path as there is an obvious conflict otherwise.