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'".


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

 

11 replies

virtualcitymatt
Celebrity
Forum|alt.badge.img+35

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

​FME should then find them when using the PythonCaller


david_r
Celebrity
  • April 30, 2021
virtualcitymatt wrote:

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
  • May 3, 2021
david_r wrote:

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+1
  • Contributor
  • August 19, 2021
david_r wrote:

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+1
  • Contributor
  • August 19, 2021
david_r wrote:

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
Contributor
Forum|alt.badge.img+7
  • Contributor
  • 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+1
  • Contributor
  • August 26, 2021
mathiku wrote:

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
Contributor
Forum|alt.badge.img+7
  • Contributor
  • August 27, 2021
johnglick wrote:

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
Contributor
Forum|alt.badge.img+7
  • Contributor
  • August 30, 2021
david_r wrote:

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
  • August 30, 2021
david_r wrote:

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+21
david_r wrote:

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings