2

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?

TheMaster
  • 45,448
  • 6
  • 62
  • 85

1 Answers1

2

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'.