Question

Hello, i'm trying to use seaborn library (python) in fme. When i want to import seaborn in a PythonCaller, i've this message : "Python Exception <ModuleNotFoundError>: No module named 'tkinter'".


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

 


11 replies

Userlevel 4
Badge +26

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

​FME should then find them when using the PythonCaller

Userlevel 4

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.

Badge

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?

Badge

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

Badge +2

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

Badge

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.

 

Badge +2

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.

Badge +2

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?

Userlevel 4

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

Userlevel 2
Badge +13

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