No module named chardet

I keep getting this error when I try to launch a specific app. I’ve already tried reinstalling it. What could be the issue?

Hi Bob,

The message signals that a dependency named ‘chardet’ is missing. This module is used by the requests package. My guess is that you are still on an old SDK version. You could solve the problem by doing one of the following:

  • upgrading your app to SDK v11.21.1 (if still on v11)
  • upgrading your app to SDK v12 or higher (required to solve v11 deprecations)
  • add requests==2.24.0 in the requirements.txt

My application is based on SDK 11, so I tried upgrading to v11.21, but this gave me another error.

We’ve seen this error before by various developers using Hyper-V (are you using Hyper-V)? The cause remains unknown. Problems were ‘solved’ when these developers switched to WSL2. Of course it is now also possible to use ‘virtual environment’ isolation mode (Installation | VIKTOR Documentation), which, I assume, will ‘solve’ this as well.

Hi Bas, this does fix the error when installing the app but when I run the app I get an error of OSError: not authorized see image below.

Are you on the latest CLI? It might be caused by wrong credentials, can you re-configure with viktor-cli configure?

Tried to reconfigure but this didn’t fix the issue.

Are you now using a virtual environment as isolation mode?

What is the output of viktor-cli check-system? Does it signal your system to be ready to start developing on the platform?

What is the response when you execute the following curl command in the Windows command prompt:

curl -X POST -i https://sys.viktor.ai/verify/ -H 'Content-Type: application/json' -d '{"dev_name": "VIKTOR_DEV", "dev_token":"VIKTOR_TOKEN", "subdomain": "SUBDOMAIN"}'

Replace “VIKTOR_DEV” with your email address and “VIKTOR_TOKEN” with your token. If this returns a status 200 OK you are using the correct credentials. In that case check the credentials file to see if this corresponds with the email and token. Also check if any extra spaces are present within the quotation marks, if that is the case delete them and try installing the app again. The credentials file is located in your user home directory, e.g. C:\Users\USERNAME\.viktor\credentials.

Eventually, the upgrade to SDK 12 resolved all issues