ModuleNotFoundError: No module named 'pkg_resources' - Failing to install Geemap

22 Views Asked by At

I have this code

import ee
import geemap.core as geemap
ee.Authenticate()
ee.Initialize(project='ee-hertelrussell')

print(ee.String('Hello from the Earth Engine servers!').getInfo())

# Load a Landsat image.
img = ee.Image('LANDSAT/LT05/C02/T1_L2/LT05_034033_20000913')
# Print image object WITHOUT call to getInfo(); prints serialized request instructions.
print(img)
# Print image object WITH call to getInfo(); prints image metadata.
print(img.getInfo())


# Initialize a map object.
m = geemap.Map()
# Define an example image.
img = ee.Image.random()
# Add the image to the map.
m.add_layer(img, None, 'Random image')
# Display the map (you can call the object directly if it is the final line).
display(m)

I get the following error when trying to run the code:

Traceback (most recent call last):
File "C:\Users\herte\PycharmProjects\geoimage\googleimage.py", line 2, in <module>
import geemap.core as geemap
File "C:\Users\herte\PycharmProjects\geoimage\.venv\Lib\site- 
packages\geemap\__init__.py", line 55, in <module>
raise e
File "C:\Users\herte\PycharmProjects\geoimage\.venv\Lib\site- 
packages\geemap\__init__.py", line 45, in <module>
from .geemap import *
File "C:\Users\herte\PycharmProjects\geoimage\.venv\Lib\site- 
packages\geemap\geemap.py", line 28, in <module>
from .conversion import *
File "C:\Users\herte\PycharmProjects\geoimage\.venv\Lib\site- 
packages\geemap\conversion.py", line 22, in <module>
import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'

I have tried

pip install geemap

and it runs successfully and when I run it again it says all requirements are satisfied

0

There are 0 best solutions below