I'm try to open port using firewall-cmd but I get error ModuleNotFoundError: No module named 'six'.

I'm try to reinstall six using easy_install, pip, pip3 and pip3.6 but it not work.

os: centos 8
python: 3.6.8
pip 20.1.1

enter image description here

2 Answers 2


first of all this issue happen due to python setuptools issue , by mistake or intentionally you upgrade it , and then after upgrade i think you reinstall six module by you or one of the libraries , what happen it will not install it correctly after upgrade in the correct path all you need is to run this command , it will move the six lib file to it's correct path so other modules can find it

cp /usr/local/lib/python3.6/site-packages/six.py /usr/lib/python3.6/site-packages/
  • thanks obeid. you saved my time. Jul 4, 2020 at 22:53
  • 1
    Honestly, this answer just pushes off the problem to the next time the user uses pip to install something. They should be reinstalling the RPM(s) and not installing random stuff as root with pip.
    – jsbillings
    Jul 6, 2020 at 13:46
  • @jsbillings Thanks for reply dear. I prefer using containers to avoid this type of errors. but in my case some one installed many packages as root then I get this error and didn't know how to solve it. after hours of search I cant find solution so this answer fine for me (just for now). can you help me to solve this problem with professional way. Jul 12, 2020 at 16:54

From https://bugzilla.redhat.com/show_bug.cgi?id=1663220 :

Force reinstalling the python3-six command did the trick;

$ sudo dnf reinstall python3-six

Worked for me too (AlmaLinux 8 ~= CentOS 8).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.