marella / chatdocs

Chat with your documents offline using AI.
MIT License
683 stars 97 forks source link

AttributeError when using charset_normalizer #68

Open trottdeaje opened 1 year ago

trottdeaje commented 1 year ago

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.

marella commented 1 year ago

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
trottdeaje commented 1 year ago

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.

marella commented 1 year ago

You can update requests as well:

pip install requests==2.31.0
trottdeaje commented 1 year ago

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

marella commented 1 year ago

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

pip install pydantic==1.10.12
trottdeaje commented 1 year ago

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