Downloading sentinel 2 using python

I have a python code for downloading sentinel 2 products. Am getting the following error. What could be the problem?

Have you installed the module pci.mod?
It seems to be unknown to your environment

How do I install the module? sorry am new to python

You can use ‘sentinelsat’
https://sentinelsat.readthedocs.io/en/master/

If you use plain python than you can follow this guide:
https://docs.python.org/3/installing/index.html

Or for Anaconda you can read this guide:
https://www.tutorialspoint.com/add-packages-to-anaconda-environment-in-python

Thanks I hae attached the code. Maybe something is wrong sentinel2_download.py (3.2 KB)

What is actually pci.mod?

The pci library is from PCI Geomatics. You are using ArcGIS Python and somehow needing PCI Geomatics python libraries. There should be more information in the full traceback. Do you have a PYTHONPATH set in your environment?
Do you have PCI Geomatica installed?

@Tsitsi How did you download the python code? Normally the best way to add modules to Python is to use pip, as it automatically downloads all dependencies too.

Thanks for the response. What I really want to do is to use python to download and atmospherically correct the Sentinel 2 data. I think Pci.mod is from PCI geomatica. I don’t have the Geomatica licence. Is there any other alternative?

Thanks. I dont have he PCI Geomatica. The main aim is to download and do atmospheric correction on Sentinel data using python.

It isn’t clear from the Python code why pci.mod is requested. Did you get sentinelsat from pypi.org? I was able to run your Python script up to the point where it prompts for the data of the flood using QGIS Python 3.6 (the version I used to configure ESA snappy).

You may also consider using EODAG. It allows you to download data from DIAS repositories as well as AWS, Theia or PEP. Configuration is a bit more complex than the above mentioned sentinelsat but in my opinion it is worth it.

Before configuring the satellite data download, I recommend that you familiarize yourself with Anaconda (as mentioned by marpet) which allows you to create multiple work environments. If you break one of them the rest are safe. This is a very convenient solution if you are working on several projects.

Have you considered using Sen2Cor if you need to perform atmospheric correction on your own?
And why don’t you actually download Sentinel-2 L2A, which is published after the atmospheric correction?

Sounds like you need more than just downloading data.
I’ve found Sam Bower’s sen2mosaic to be good for downloading and processing to level2. Check it out https://sen2mosaic.readthedocs.io/en/latest/

It uses python, but installation and usage documentation is all in the docs.

Cheers