Skip to main content
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'".

  • April 30, 2021
  • 11 replies
  • 105 views

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

 

11 replies

virtualcitymatt
Celebrity
Forum|alt.badge.img+47
  • Celebrity
  • 2000 replies
  • April 30, 2021

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

​FME should then find them when using the PythonCaller


david_r
Celebrity
  • 8392 replies
  • April 30, 2021

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


  • Author
  • 2 replies
  • May 3, 2021

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.


johnglick
Contributor
Forum|alt.badge.img+7
  • Contributor
  • 33 replies
  • August 19, 2021

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?


johnglick
Contributor
Forum|alt.badge.img+7
  • Contributor
  • 33 replies
  • August 19, 2021

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


mathiku
Supporter
Forum|alt.badge.img+8
  • Supporter
  • 69 replies
  • August 26, 2021

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


johnglick
Contributor
Forum|alt.badge.img+7
  • Contributor
  • 33 replies
  • August 26, 2021

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.

 


mathiku
Supporter
Forum|alt.badge.img+8
  • Supporter
  • 69 replies
  • August 27, 2021

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.


mathiku
Supporter
Forum|alt.badge.img+8
  • Supporter
  • 69 replies
  • August 30, 2021

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?


david_r
Celebrity
  • 8392 replies
  • August 30, 2021

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


kailinatsafe
Safer
Forum|alt.badge.img+23
  • Safer
  • 720 replies
  • August 31, 2021

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).