broamski / aws-mfa

Manage AWS MFA Security Credentials
MIT License
1.01k stars 163 forks source link

ModuleNotFoundError: No module named 'awsmfa' #57

Open michal-kubicki opened 4 years ago

michal-kubicki commented 4 years ago

After upgrading Python from 2.7.x to 3.8.x (on macOS) I get the following error:

Traceback (most recent call last):
  File "/usr/local/bin/aws-mfa", line 6, in <module>
    from awsmfa import main
ModuleNotFoundError: No module named 'awsmfa'

I did uninstall aws-mfa, relinked Python, installed aws-mfa again but it didn't help.

fkarakas commented 3 years ago
brew switch python 3.7.7
brew unlink python@3.8
toddmetheny commented 3 years ago

I'm also having this issue

fkarakas commented 3 years ago

i got this issue after a brew upgrade, i had to resintall pip3 with a curl


curl -sS https://bootstrap.pypa.io/get-pip.py | sudo python3
pip3 uninstall aws-mfa
pip3 install aws-mfa
toddmetheny commented 3 years ago

@fkarakas I tried that but I'm still getting the same error. I'd take welcome any other ideas if you have any.

fkarakas commented 3 years ago

i don't know, another try...


brew remove python3
brew install python3
curl -sS https://bootstrap.pypa.io/get-pip.py | sudo python3
pip3 uninstall aws-mfa
pip3 install aws-mfa
bzswords commented 3 years ago

I ran into the same issue. It turned out my pip3 installation was messed up. To get to the point aws-mfa worked for me again I ran:

python3 -m ensurepip --default-pip
pip3 uninstall aws-mfa
pip3 install aws-mfa

macOS 11.1, python 3.9.1

kennethlynne commented 10 months ago

It was broken for me with both python 3.11 and 3.10. Using conda and python 3.9 it finally works again.

conda activate <your python 3.9 env>
python -m ensurepip --default-pip
pip install aws-mfa

success