[GH-ISSUE #1039] Import error if charset-normalizer >= 3.3.0 is installed #620

Closed
opened 2026-02-28 00:00:20 +03:00 by kerem · 1 comment
Owner

Originally created by @dwinkler1 on GitHub (Nov 20, 2023).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/1039

Describe the bug
There is an import error with charset-normalizer version>=3.3.0

Your code

import spotipy

Expected behavior

Output

ImportError: cannot import name 'is_ascii' from 'charset_normalizer.utils' (/Users/daniel/mambaforge/envs/research/lib/python3.11/site-packages/charset_normalizer/utils.py)

Environment:

  • OS: Mac
  • Python version 3.11.6
  • spotipy version 2.23.0
  • your IDE (if using any): Jupyter Kernel in VS Code

Additional context
Add any other context about the problem here.

Originally created by @dwinkler1 on GitHub (Nov 20, 2023). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/1039 **Describe the bug** There is an import error with `charset-normalizer` version>=3.3.0 **Your code** ``` import spotipy ``` **Expected behavior** **Output** ``` ImportError: cannot import name 'is_ascii' from 'charset_normalizer.utils' (/Users/daniel/mambaforge/envs/research/lib/python3.11/site-packages/charset_normalizer/utils.py) ``` **Environment:** - OS: Mac - Python version 3.11.6 - spotipy version 2.23.0 - your IDE (if using any): Jupyter Kernel in VS Code **Additional context** Add any other context about the problem here.
kerem 2026-02-28 00:00:20 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@Ousret commented on GitHub (Dec 11, 2023):

It is due to a dual version of charset-normalizer present in vendored libs of conda vs your regular site-package environment.

A quick fix is to align both versions, unfortunately. Force install a older version of charset-normalizer.
It's a known issue. Spotipy can't help for that one.

<!-- gh-comment-id:1849670975 --> @Ousret commented on GitHub (Dec 11, 2023): It is due to a dual version of charset-normalizer present in vendored libs of conda vs your regular site-package environment. A quick fix is to align both versions, unfortunately. Force install a older version of charset-normalizer. It's a known issue. Spotipy can't help for that one.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotipy#620
No description provided.