py-gpt icon indicating copy to clipboard operation
py-gpt copied to clipboard

PyGPT crash on startup with charset-normalizer 3.2.0 circular import

Open endolith opened this issue 4 months ago • 0 comments

AI-written:

PyGPT crashes on startup with a circular import error in charset-normalizer 3.2.0 when installing in a fresh conda environment. The crash occurs during theme application and prevents the application from starting.

Steps to reproduce:

  1. Create fresh conda environment: conda create --name pygpt
  2. Activate environment: conda activate pygpt
  3. Install PyGPT: pip install pygpt-net
  4. Run: pygpt

Error:

AttributeError: partially initialized module 'charset_normalizer' has no attribute 'md__mypyc' (most likely due to a circular import)
Fatal Python error: seterror_argument failed to call update_mapping

Workaround: Downgrading charset-normalizer resolves the issue:

pip install charset-normalizer==3.3.2

Environment:

  • Windows 10, AMD64
  • Conda 24.11.3 with Python 3.10.13
  • PyGPT 2.6.65
  • charset-normalizer 3.2.0 (problematic version)

The issue appears to be a compatibility problem with charset-normalizer 3.2.0 and the dependencies pulled in by PyGPT installation.

Suggested fix: Add a constraint to pyproject.toml:

charset-normalizer = ">=2.0,<3.2.0 || >3.2.0"

endolith avatar Oct 19 '25 21:10 endolith