I am trying to import the module ee to use the google earth engine according to the documentation on the dedicated website. https://developers.google.com/earth-engine/guides/python_install
I got this error:
import ee
ModuleNotFoundError Traceback (most recent call last)
/tmp/ipykernel_35721/2985164896.py in <module>
----> 1 import ee
~/anaconda3/lib/python3.7/site-packages/ee/__init__.py in <module>
----> 1 from .main import main
~/anaconda3/lib/python3.7/site-packages/ee/main.py in <module>
8 import stat
9 import plistlib
---> 10 import StringIO
11 import platform
12 import time
ModuleNotFoundError: No module named 'StringIO'
The puzzling thing is that I can import this module without ee flawlessly.
from io import StringIO
import io
Would anyone had the same issue?
It seems like there might have been an incorrect installation command used previously. Please use the following correct command for installation:
pip install earthengine-api
After running the above command you can try importing ee again.
Modifying the original python file at the following location solve the problem:
~/anaconda3/lib/python3.7/site-packages/ee/main.py
Line 10, replace 'import StringIO' by 'from io import StringIO'.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With