Conda environment & Seaborn

Hello All,
When running ‘import seaborn’ in Python script I get an error message ‘module not found…’
But checking seaborn installation looks correct (see images)

So, What did I do incorrectly ?

Many thanks for advise

@olivier92410 can you show how your Python node is configured. I have noticed that sometimes a newly installed packages would run but would not immediately show up once you open the node. Maybe you check that.

Then … Seaborn is now part of the bundled Python environment. So you could try to use that also:

Orf you might use a Conda Environment propagation with all your packages and give that to the Python node (sometimes I experienced that that would help).

Many thanks for reply!

After having posted this subject, I had a look to Conda Environment Propagation (see picture). No trace of Seaborn ! While Seaborn package is really installed in opt/anaconda3/pkgs…

Something wrong there, but can’t see what at the moment

What is your thought on that case then ?

Thank you for your help !

(Install Anaconda Packages – KNIME Hub) ckages](Install Anaconda Packages – KNIME Hub) ckages](Install Anaconda Packages – KNIME Hub)

@olivier92410 I think seaborn is in your “base” environment while KNIME uses the “py3_knime” environment. So you might want to activate the environment in your (base) prompt and install the seaborn package again.

conda activate py3_knime
conda install -c conda-forge seaborn

or in one step from the base prompt:

conda install -n py3_knime -c conda-forge seaborn

You might want to check out how to manage Python environments:

An even better way to handle things would be to have your packages in a YML file and change that and then order conda to update your environment once you add a package. Like in this example. Basic KNIME Python and then added some R packages (you could manage your own selection).

Maybe you read the somewhat lengthy text in the blue square here about KNIME and Python. Handling environments seems to be somewhat complicated at first. But once you grasp the 3-4 basic concepts it becomes a powerful tool - and KNIME would support you thru the environment propagation.


Thank you for your help !
Those two line were relevant…
conda activate py3_knime
conda install -c conda-forge seaborn

It finally works now, I’m gonna have a look at your suggestions on how to handle that kind of situations

Many thanks again !


This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.