Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError with ptitprince and seaborn - '_CategoricalScatterPlotter' not found #71

Open
chainReactionCol opened this issue Mar 27, 2024 · 3 comments

Comments

@chainReactionCol
Copy link

I'm experiencing an import issue when trying to use the ptitprince library alongside seaborn. After installing seaborn version 0.11.0 as required by ptitprince 0.2.7, I encountered a dependency conflict indicating that seaborn 0.13.0 is incompatible. Upon adjusting the seaborn version, I tried to import ptitprince, but I received the following error:

ImportError: cannot import name '_CategoricalScatterPlotter' from 'seaborn.categorical'

It seems that _CategoricalScatterPlotter is not available in the seaborn.categorical module. I have checked my seaborn version to confirm I'm running the version I just installed is 0.13.0

I'm not sure if this issue is due to a version mismatch or if the class/function has been removed or renamed in a recent seaborn update. I'm looking for any guidance on how to resolve this issue so I can use ptitprince for my data visualization needs.

Has anyone else faced this issue, or does anyone know how to solve this or work around it?

I'm encountering a compatibility issue between ptitprince version 0.2.7 and seaborn. When I install ptitprince, it requires seaborn version 0.11.0. However, after installation, my terminal reports a conflict with seaborn 0.13.0 being installed, which is incompatible with ptitprince 0.2.7.

Here's the error message from my terminal:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
ptitprince 0.2.7 requires seaborn==0.11, but you have seaborn 0.13.0 which is incompatible.

After downgrading seaborn to 0.11.0 to match the ptitprince requirements, I attempted to import ptitprince and was met with the following ImportError:

ImportError: cannot import name '_CategoricalScatterPlotter' from 'seaborn.categorical'

@will-hou
Copy link

Hi! Not a maintainer but I've run into the same issue for a while now.

Downgrading seaborn to 0.11.0 did work for me. I made a Python venv and pip installed ptitprince directly into it .

However, there have been some substantial changes to the Seaborn API since 0.11.0 so it would be helpful to get an update pushed out. I'll see if I can spin up a PR and ping the maintainers.

@will-hou
Copy link

There have been some substantial changes within the Seaborn API since version 0.11.0 so I think it will require a fairly substantial rewrite.

I can try to take a crack at this when I have time but it won't be for another few weeks at the earliest.

Here's the problematic diff in categorical.py

mwaskom/seaborn@v0.11.0...v0.13#diff-42efb6918bd7e5f5a7b683aec2b32395b4ed303d3e2dae08f0e312171f7586dd

@chainReactionCol
Copy link
Author

Thanks! I´ll try it once again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants