Sentinel Install Error - Importing 'MosaickingOrder'

Hi!
I was trying to play around with sentinel2 data and got the following error when trying to follow the documentation:
cannot import name 'MosaickingOrder' from 'sentinelhub.constants' (C:\Users\Darren\Anaconda3\lib\site-packages\sentinelhub\constants.py)
I have sentinel version 3.5.2 installed according to conda list

Hi!

It seems like there is an issue with your installation. Did you install it via pip?
You can also double-check the version like this:

>>> import sentinelhub
>>> sentinelhub.__version__
'3.5.2'

If your version is indeed 3.5.2 then maybe try re-installing the package.

Hi Ziga,
Thanks for the help!
I reinstalled conda as I think there was a dependency issue. After reinstalling, I used sentinelhub.__version__ and found sentinel hub was on 3.4.4 even after a fresh installation using:
$ conda install -c conda-forge sentinelhub[AWS]
When checking conda list after a restart, I get:
sentinelhub 3.4.4 pyhd8ed1ab_0 conda-forge

The conda-forge usually lags a bit behind with the versions. In the 3.4.4 version there is no MosaickingOrder yet, so it cannot be imported.

But you can just use a string instead, so MosaickingOrder.LEAST_RECENT is equivalent to "leastRecent". Even in the later versions strings are still an acceptable input, so the code shouldn’t break after the package is updated.

1 Like

Hi!
Thanks for your help! :slight_smile:

Hi,

I’m getting the same error. I have version 3.5.2 installed, have uninstalled and reinstalled with conda, still getting the same error, and still on version 3.5.2.

I can’t check the version as suggested above with sentinelhub.version, as the package won’t even import.

Is the fix here to revert to version 3.4.4? Bit confused, would appreciate any help!

Hi @sophienolan,

The highest sentinelhub-py version available for installation with Conda is 3.4.4. Installing the latest version 3.5.2 can only be done with pip.

Oh right okay, just realised it never properly uninstalled the original version I installed with pip.
So which .py file is ziga.luksic suggesting to alter?