Skip to main content

Is there a way to have this python module in FME?

 

You need to copy the python modules into Documents>FME>Plugins>Python

​FME should then find them when using the PythonCaller


You need to copy the python modules into Documents>FME>Plugins>Python

​FME should then find them when using the PythonCaller

This works great for simpler modules, but for larger packages with dependencies it might be easier to install them using the pip package manager, see https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Workbench/Workbench/Installing-Python-Packages.htm


This works great for simpler modules, but for larger packages with dependencies it might be easier to install them using the pip package manager, see https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Workbench/Workbench/Installing-Python-Packages.htm

In fact, it's the way i installed seaborn, pandas and other modules. But for tkinter, it doesn't work. Tkinter comes normally bundled with Python.


This works great for simpler modules, but for larger packages with dependencies it might be easier to install them using the pip package manager, see https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Workbench/Workbench/Installing-Python-Packages.htm

i have a similar problem, did you figure out a solution?


This works great for simpler modules, but for larger packages with dependencies it might be easier to install them using the pip package manager, see https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Workbench/Workbench/Installing-Python-Packages.htm

So turns out I just needed to tell the library I was using (matplotlib in this case) to not use tkinter. https://openwritings.net/pg/matplotlib/using-matplotlib-without-installing-tkinter-gui-framework


I have the same problem when calling WhiteboxTools. Thing is that tkinter is inside the plugins folder.


I have the same problem when calling WhiteboxTools. Thing is that tkinter is inside the plugins folder.

In my case I had to include this line: matplotlib.use('Agg') # Bypass the need to install Tkinter GUI framework.

Seems like FME will not use Tkinter even if it’s installed.

Instead of viewing the output using Tkinter I passed a png to a feature so I could view it in fme workbench.

 


In my case I had to include this line: matplotlib.use('Agg') # Bypass the need to install Tkinter GUI framework.

Seems like FME will not use Tkinter even if it’s installed.

Instead of viewing the output using Tkinter I passed a png to a feature so I could view it in fme workbench.

 

Thanks. That doesn't work for me though.


This works great for simpler modules, but for larger packages with dependencies it might be easier to install them using the pip package manager, see https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Workbench/Workbench/Installing-Python-Packages.htm

@david_r​  Would you care to elaborate on what to do with Tkinter when it still throws no module after pip installation?


This works great for simpler modules, but for larger packages with dependencies it might be easier to install them using the pip package manager, see https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Workbench/Workbench/Installing-Python-Packages.htm

Using pip together with the Python interpreter installed with FME does not always work 100%, especially for FME before 2020 (in my experience) and/or if the packages are particularly complex in their installation.

Perhaps the best (or, at least easiest) solution is to install a stand-alone Python interpreter (e.g. from python.org) and to install all the third-party modules there. You can then point FME to this interpreter, see https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Workbench/Workbench/Python-Compatibility.htm


This works great for simpler modules, but for larger packages with dependencies it might be easier to install them using the pip package manager, see https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Workbench/Workbench/Installing-Python-Packages.htm

@david_r​ , I think you're right regarding using a custom Python interpreter (one that comes with tkinter).


Reply