chatdocs icon indicating copy to clipboard operation
chatdocs copied to clipboard

AttributeError when using charset_normalizer

Open trottdeaje opened this issue 1 year ago • 6 comments

Hiya,

I followed the readme and got stuck trying to add documents with the error below:

AttributeError: partially initialized module 'charset_normalizer' has no attribute 'md__mypyc' (most likely due to a circular import)

Link to traceback report: pastebin Link to chatdocs.yml contents: pastebin

Environment:

Windows 11 GPU driver version: 536.99 Cuda version: 12.1 Python version: 3.11.4 Charset Version: 2.0.4

Additional notes:

Not sure if it's important, but I made a new conda environment specifically for this project so there shouldn't be any conflicts.

trottdeaje avatar Aug 21 '23 19:08 trottdeaje

Hi, this looks similar to https://github.com/microsoft/TaskMatrix/issues/242#issuecomment-1475521495 Can you try updating charset-normalizer package:

pip install --force-reinstall charset-normalizer==3.1.0

marella avatar Aug 21 '23 20:08 marella

Thanks for the quick response. Running that command installs that version of charset-normalizer but shows this error alongside it.

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. requests 2.28.1 requires charset-normalizer<3,>=2, but you have charset-normalizer 3.1.0 which is incompatible.

trottdeaje avatar Aug 21 '23 20:08 trottdeaje

You can update requests as well:

pip install requests==2.31.0

marella avatar Aug 21 '23 20:08 marella

Running the chatdocs add command again I get a new error:

PydanticImportError: BaseSettings has been moved to the pydantic-settings package.

Link to traceback report: pastebin

trottdeaje avatar Aug 21 '23 20:08 trottdeaje

I fixed this error in repo but haven't released yet. Running the following should fix it:

pip install pydantic==1.10.12

marella avatar Aug 21 '23 20:08 marella

Looks like that fixed it, thanks!

Though, continuing with the setup, running chatdocs ui The resulting page is a 404.

Error code: 404 Message: Not Found. Error code explanation: 404 - Nothing matches the given URI.

Here's the terminal output when running. Also I noticed that using CTRL + C to end the process doesn't seem to work.

(chatdocs_env) C:\Users\Work>chatdocs ui load INSTRUCTOR_Transformer max_seq_length 512 Using embedded DuckDB with persistence: data will be stored in: db

  • Serving Quart app 'chatdocs.ui'
  • Environment: production
  • Please use an ASGI server (e.g. Hypercorn) directly in production
  • Debug mode: False
  • Running on http://localhost:5000 (CTRL + C to quit) [2023-08-21 21:55:32 +0100] [10736] [INFO] Running on http://127.0.0.1:5000 (CTRL + C to quit)

trottdeaje avatar Aug 21 '23 21:08 trottdeaje