Click will abort further execution because Python 3 was configured to use ASCII as encoding for the environment

If you are trying to execute tests case you must set the following environment variables each time:

export LC_ALL=en_US.utf-8
export LANG=en_US.utf-8

Doing this each time will resolve the error.

It may also be possible to set this in your IDE run configuration as

LC_ALL=en_US.UTF-8;LANG=en_US.UTF-8

For example see the following setting in PyCharm 2016:


Adding more to the existing solutions:

If you see something like this error in Python 3:

Traceback (most recent call last):
  ...
RuntimeError: Click will abort further execution because Python 3 was
  configured to use ASCII as encoding for the environment. Either switch
  to Python 2 or consult http://click.pocoo.org/python3/ for
  mitigation steps.

You are dealing with an environment where Python 3 thinks you are restricted to ASCII data. The solution to these problems is different depending on which locale your computer is running in.

For instance, if you have a German Linux machine, you can fix the problem by exporting the locale to de_DE.utf-8:

export LC_ALL=de_DE.utf-8
export LANG=de_DE.utf-8

If you are on a US machine, en_US.utf-8 is the encoding of choice. On some newer Linux systems, you could also try C.UTF-8 as the locale:

export LC_ALL=C.UTF-8
export LANG=C.UTF-8

Taken from the Python 3 Surrogate Handling