py-gpt
py-gpt copied to clipboard
PyGPT crash on startup with charset-normalizer 3.2.0 circular import
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:
- Create fresh conda environment:
conda create --name pygpt - Activate environment:
conda activate pygpt - Install PyGPT:
pip install pygpt-net - 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"