Importing the FME modules seems to work and I'm using the same interpreter as with the WorkspaceRunner.py sample. "testWorkSpace.fmw" is an empty workspace.
I also found that when executing WorkspaceRunner.py without going through fme.exe i get the following error:
FMEWorkspaceRunner: Error in dialog creation during initialization
Are you able to provide more information on the Python environment you're using when running into this error? For example, what version of FME and the Python interpreter is used?
I was able to reproduce the error you're seeing when using the fmeobjects.FMEWorkspaceRunner() class with python.org's Python 3.8 and 3.9 interpreters. It appears to be resolved if the FME install directory is inserted into the PATH environment variable in addition to using os.add_dll_directory(). The dialog error may be related to QT and should be resolved by setting the environment variable QT_QPA_PLATFORM_PLUGIN_PATH.
For example, the script below completes successfully with FME 2022 and Python 3.9.
## Set QT_QPA_PLATFORM_PLUGIN_PATH environment variable if encountering error about QT or dialogs os.environ['QT_QPA_PLATFORM_PLUGIN_PATH']=r"C:\Program Files\FME\qtplugins\platforms"
Are you still encountering errors after running the modified script?
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.
Hi, can you try adding a Creator transformer in your empty workspace and see if that makes a difference. Running an empty workspace could very well be the issue.
Hi, can you try adding a Creator transformer in your empty workspace and see if that makes a difference. Running an empty workspace could very well be the issue.
Are you able to provide more information on the Python environment you're using when running into this error? For example, what version of FME and the Python interpreter is used?
Are you able to provide more information on the Python environment you're using when running into this error? For example, what version of FME and the Python interpreter is used?
I was able to reproduce the error you're seeing when using the fmeobjects.FMEWorkspaceRunner() class with python.org's Python 3.8 and 3.9 interpreters. It appears to be resolved if the FME install directory is inserted into the PATH environment variable in addition to using os.add_dll_directory(). The dialog error may be related to QT and should be resolved by setting the environment variable QT_QPA_PLATFORM_PLUGIN_PATH.
For example, the script below completes successfully with FME 2022 and Python 3.9.
## Set QT_QPA_PLATFORM_PLUGIN_PATH environment variable if encountering error about QT or dialogs os.environ['QT_QPA_PLATFORM_PLUGIN_PATH']=r"C:\Program Files\FME\qtplugins\platforms"
I was able to reproduce the error you're seeing when using the fmeobjects.FMEWorkspaceRunner() class with python.org's Python 3.8 and 3.9 interpreters. It appears to be resolved if the FME install directory is inserted into the PATH environment variable in addition to using os.add_dll_directory(). The dialog error may be related to QT and should be resolved by setting the environment variable QT_QPA_PLATFORM_PLUGIN_PATH.
For example, the script below completes successfully with FME 2022 and Python 3.9.
## Set QT_QPA_PLATFORM_PLUGIN_PATH environment variable if encountering error about QT or dialogs os.environ['QT_QPA_PLATFORM_PLUGIN_PATH']=r"C:\Program Files\FME\qtplugins\platforms"