Question

Changes to Python paths in 2019 (and 2020) ?

  • 19 February 2020
  • 5 replies
  • 7 views

Userlevel 1
Badge +22

Hi list.

I've avoided the 2019 version due to multiple issues. So this is a bit late, I know.

But now I tried to run a workspace I made in 2018 in 2019 (and 2020 beta), and both failed to run my custom transformer, giving an error about not being able to locate its components.

All my custom transformers are located in a shared location using the "Shared FME Folders" feature. This worked fine in 2018 and previously.

Only when I specifically added the path to the shared Transformers sub folder to my FME_PYTHON_PATH, did 2019 it find it. But then what's the point of having an official "Shared FME Folders" installation ?

Was the "Shared FME Folders" functionality changed in 2019+ ?

Cheers


5 replies

Badge

In FME 2019, we removed Documents/FME/Transformers from FME's Python search path in order to simplify the search path and reduce various unexpected side effects. Python files should instead be placed in Documents/FME/Plugins/Python.

Userlevel 1
Badge +22

In FME 2019, we removed Documents/FME/Transformers from FME's Python search path in order to simplify the search path and reduce various unexpected side effects. Python files should instead be placed in Documents/FME/Plugins/Python.

But this goes against the very idea of "Shared Folders", doesn't it ?

My original concern was sharing transformers across my installed versions, but it's also a question of sharing between users of FME, if such a need arises.

How is the latter need serviced ?

Badge +6

But this goes against the very idea of "Shared Folders", doesn't it ?

My original concern was sharing transformers across my installed versions, but it's also a question of sharing between users of FME, if such a need arises.

How is the latter need serviced ?

Hi @lifalin2016, FME will check for any python files inside your "FME Shared Folders" if they are placed in a folder called Plugins/Python. So this should work in almost the same way it did before, the main difference would be that in FME 2019, you would need to create a Plugins folder in that shared location and place the .py files there instead of keeping them in the Transformers folder.

Does that help to address your concerns? Just let me know if you have any additional questions or concerns about this. I'm happy to take a closer look if we've missed anything.

Userlevel 1
Badge +22

Hi @lifalin2016, FME will check for any python files inside your "FME Shared Folders" if they are placed in a folder called Plugins/Python. So this should work in almost the same way it did before, the main difference would be that in FME 2019, you would need to create a Plugins folder in that shared location and place the .py files there instead of keeping them in the Transformers folder.

Does that help to address your concerns? Just let me know if you have any additional questions or concerns about this. I'm happy to take a closer look if we've missed anything.

Thanks Laura.

I created the folders, and copied everything from "Transformers" to "Plugins/Python", and now 2019 worked as expected. I'll need to find a way to have a single repository, i.e. have 2018 and previous look into the new folders, so any changes made doesn't have to made twice.

Interesting enough, before I copied the transformers, 2019 would know about them, as I could add them to my workspace, but it failed when running them. It seems that Workbench still looks in the old folder, whereas fme.exe doesn't.

I'm just curious why 2019 didn't add the folders automatically when it accessed the shared folder first time. It did add some other folders.

Cheers.

Badge +6

Thanks Laura.

I created the folders, and copied everything from "Transformers" to "Plugins/Python", and now 2019 worked as expected. I'll need to find a way to have a single repository, i.e. have 2018 and previous look into the new folders, so any changes made doesn't have to made twice.

Interesting enough, before I copied the transformers, 2019 would know about them, as I could add them to my workspace, but it failed when running them. It seems that Workbench still looks in the old folder, whereas fme.exe doesn't.

I'm just curious why 2019 didn't add the folders automatically when it accessed the shared folder first time. It did add some other folders.

Cheers.

No problem! Ah, yes I can see that having an environment with a mix of FME versions could be tricky. Just to check, have you tried this with 2018 and found that FME doesn't pick up the python files from the plugins folder?

Regarding your comment on 2019 knowing about the transformers before you copied them and then failed when running them, did the workspaces fail with python related errors? If so, I think that would be expected. FME currently doesn't have a way to know if a custom transformer uses an external python script, so it would think everything was ok as long as it could find the transformer definition and wouldn't fail until it got to a python caller in the transformer and attempted to load the script.

On the folders not being automatically added, I'll put in a request here to add those. I think they should be automatically included when you set up the shared folder.

Reply