Skip to content
Advertisement

Module Six has no attribute ensure_text

Out of the blue, my python installation seems to have broken. When trying to run a python script, I get the following…

JavaScript

Trying to reinstall the module using pip also breaks…

JavaScript

I have read that this is caused by running pip as root, but I have not done this. I also haven’t made any recent upgrades or installed any new packages. So far I have tried setting PYTHONPATH, reinstalling python, and reinstalling pip, and none of these options have worked. Does anyone have any ideas? Thanks in advance!

EDIT: I also tried updating python and pip, which didn’t work.

Requested Information:

JavaScript

Advertisement

Answer

I was able to update six by doing a wget https://raw.githubusercontent.com/benjaminp/six/master/six.py in ~/.local/lib/python3.9/site-packages. This solved the problem.

Advertisement