sentinel-hub / field-delineation

Field delineation with Sentinel-2 data from Sentinel-Hub and a ResUnet-a architecture.
MIT License
149 stars 53 forks source link

fb libary is not compatible with Python 3.x #20

Closed bumie-e closed 1 year ago

bumie-e commented 1 year ago

While importing fb modules in a colab notebook,

from fd.scripts.download import batch_download gave this error

Traceback (most recent call last):

File "/usr/local/lib/python3.8/dist-packages/IPython/core/interactiveshell.py", line 3326, in run_code exec(code_obj, self.user_global_ns, self.user_ns)

File "", line 17, in from fd.scripts.download import batch_download

File "/usr/local/lib/python3.8/dist-packages/fd.py", line 53 print "Directory or database already exists. Use -f or --force to delete and initialize" ^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print("Directory or database already exists. Use -f or --force to delete and initialize")?

The error shows that the print function is written in Python 2.x. How do I resolve this?

devisperessutti commented 1 year ago

Hi @bumie-e

It looks like you installed the wrong fd package, possibly from pypi.

Our code definitely works for Python 3.*.

To install our package you DON'T do pip install fd, but you have to first install the requirements and then the package, as shown in the README

pip install -r requirements.txt
python setup.py install --user

I suggest you create a new fresh Python environment, install field delineation and try again.

Let us know if it works.

bumie-e commented 1 year ago

Yes, using pip install fd was the issue. It works now, thanks!