I seen this happening when molecule was installed using pip install --user molecule on a specific machine but I was not able to reproduce it myself.

I will need more feedback in order to investigate it.
I'm encountering the same error myself on my Mac. I used pip3 to install with the --user flag.
Are there any logs I can provide to help?
Apparently in the last days I got lots of weird problems when installing packages as --user. I ended up using a real virtualenv and removing any packages from .local.
I hope this helps. I am almost sure the issue is not relaed to molecule.
Weird....you're right, had the same result..
Created a new venv, installed molecule, working fine now...
Is experiencing the same problem. What should I do?
Created a new venv, installed molecule, working fine now...
@S7R4nG3, can you explain more?
Not really...I was attempting to install molecule locally on my Mac, instead I went into my ansible role directory, created a new venv (python3 -m venv .) allow it to setup totally then use ./bin/pip3 install molecule and it install and ran fine....
Be sure that you also install the driver as well for however you want molecule to run (docker etc) ./bin/pip3 install molecule[docker]
I am closing it as we failed to find a way to reproduce it. Still if someone finds one, we should reopen.
Just for information found why to this error in my case.
My ansible was configured to use python3 by default (cause of python 2 end of life)
ansible --version
ansible 2.9.5
[...]
python version = 3.7.5 (default, Apr 19 2020, 20:18:17) [GCC 9.2.1 20191008]
so pip install molecule is not enough in this case.
Have to python3 -m pip install molecule to fix the error message
My solution was to uninstall ansible, after that install molecule over pip3, it will install ansible too.
pip uninstall ansible
pip3 uninstall molecule
pip3 install molecule
And error is history.
Most helpful comment
My solution was to uninstall ansible, after that install molecule over pip3, it will install ansible too.
pip uninstall ansiblepip3 uninstall moleculepip3 install moleculeAnd error is history.