Tag Archives: Programming Miscellany

How to solve the problem of error reporting in the introduction of Python Django no module name ‘Django. Utils. Six’

Today, when learning Django framework, I wrote the following command:

from django.utils.six import BytesIO

After that, an error is reported as follows:

I looked up the relevant documents, various, did not come to the point.

In fact, the root of this problem is very easy to understand: there may be no such file as six. Py under the path of Django/utils /!!

Taking this machine as an example, I first checked the following path. There is no file “six. Py”.

Next, I chose to use the command line:

pip install six

But the previous command still runs and reports an error, although the six. Py has been downloaded.

At this time, you need to go to your PIP folder and find the file “six. Py”

Then copy the file and paste it under the path of Django/utils

At this point, rerun the command

from django.utils.six import BytesIO

After running successfully, no error is reported

It’s done!!