问题
Apologies if this is a silly question. I searched in stackoverflow. But did not find the solution. I am working on migration from Python 2.7 to Python 3.8. I am getting the below error for one program.
Please help me.
Traceback (most recent call last):
File " <Path>\main.py", line 17, in <module>
import script1
File " <Path>\script1.py", line 9, in <module>
import script2
File " <Path>\script2.py", line 10, in <module>
from googleapiclient import discovery
ModuleNotFoundError: No module named 'googleapiclient'
File " <Path>\script1.py", line 9, in <module> >>> import dfareporting_utils
File " <Path>\script2.py", line 10, in <module> >>> from googleapiclient import discovery
回答1:
If you don't have to use Python 3.8, please uninstall it and install 3.6.X (X can be 5, my suggestion). The last version of Python 3.8 still can have bugs.
After, please enter this command pip install googleapiclient
on cmd, or, install googleapiclient
manual. If you don't know how to do it, inform me, I can edit my answer.
回答2:
Thanks for your responses. I think Python3.8 is not good option.
pip install google-api-python-client
The above one fixed my issue.
I compared Python2.7 & Python3.8 pip list. So I installed version of 2.7 in 3.8.
来源:https://stackoverflow.com/questions/58989483/modulenotfounderror-no-module-named-googleapiclient