While are you installed AWS CLI alongside Python3 and boto3 and when are you tried to run AWS CLI, then you will get ImportError: cannot import name ‘docevents’ from ‘botocore.docs.bcdoc’, this error.
In this article, we will discuss about this ImportError: cannot import name ‘docevents’ from ‘botocore.docs.bcdoc’ error in Python. And how to resolve the error all the possible solutions with examples.
How ImportError: cannot import name ‘docevents’ from ‘botocore.docs.bcdoc’ Error Occurs?
Most of the time you get this error while are you installed AWS CLI alongside Python3 and boto3. Looks like the below.
ImportError: cannot import name 'docevents' from 'botocore.docs.bcdoc'
How to Fix ImportError: cannot import name ‘docevents’ from ‘botocore.docs.bcdoc’ Error?
There are different ways to fix ImportError: cannot import name ‘docevents’ from ‘botocore.docs.bcdoc’ this error. Let us take a look at every solution.
How to Fix ImportError: cannot import name ‘docevents’ from ‘botocore.docs.bcdoc’ Error?
For the solve ImportError: cannot import name ‘docevents’ from ‘botocore.docs.bcdoc’ Error You need to downgrade awscli version aws-cli/1.18.105 and botocore version botocore/1.17.28 then run the command below. Now, your error will be solved.
How to Fix ImportError: cannot import name ‘docevents’ from ‘botocore.docs.bcdoc’ Error?
For the solve ImportError: cannot import name ‘docevents’ from ‘botocore.docs.bcdoc’ Error First you have to update your pip by running this command: python3 -m pip install –upgrade pip Then uninstall awscli running this command: python3 -m pip uninstall awscli after successfully uninstalled then re-install awscli by this command: python3 -m pip install awscli. Now, your will be gone.
Solution 1: Downgrade awscli and botocore
You have downgrade awscli and botocore. Run this command:
pip3 install awscli==1.18.105
Downgrade botocore by run this command:
pip3 install botocore==1.17.28
Solution 2: reinstall awscli
First you have to update your pip by run this command:
python3 -m pip install --upgrade pip
Then, uninstall awscli by running this command.
python3 -m pip uninstall awscli
after successfully uninstalling awscli you need to re-install awscli.
python3 -m pip install awscli
Now, I hope your error will be solved.
Conclusion
In this article, we have discussed what causes the error and we have discussed ways to fix the error.
we hope this article has been informative. Thank you for reading. Kindly comment and let us know if you found it helpful.