ocean-data-factory-sweden / kso

Notebooks to upload/download marine footage, connect to a citizen science project, train machine learning models and publish marine biological observations.
GNU General Public License v3.0
4 stars 12 forks source link

Notebook 5+6: Error while importing panoptes_client #133

Closed Diewertje11 closed 1 year ago

Diewertje11 commented 1 year ago

When you try to run notebook 5 in Colab with a clean runtime, you get an error in the 2nd cell.

FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/lib/python3.8/dist-packages/urllib3-1.24.3.dist-info/METADATA'

This comes from: import kso_utils.tutorials_utils as t_utils In which it tries to import: from panoptes_client import Project

If you look in the google colab files, it does indeed not contain this file. However, it does contain a different version: /usr/local/lib/python3.8/dist-packages/urllib3-1.26.14.dist-info

The strange thing is, that when you run the command again: import kso_utils.tutorials_utils as t_utils Then there is no problem and it just runs. I do not understand why this is the case and I cannot find it online. Does anyone know this??

I do have 2 work arounds to prevent the error from occurring:

  1. Install from the requirements.txt file from the data-management repository. Then the error is not occurring, so probably the packages in that requirements list are better in agreement with each other. (This also brings up the question for me: Why are there 2 different repositories and 2 different requirements files? Or is this just due to historical reasons?)
  2. Import the panoptes_client in the tutorials_utils with a try except, since it can import it the second time

try: from panoptes_client import Project except: from panoptes_client import Project

jannesgg commented 1 year ago

The requirements files differ considerably since the one for this repository is based on the official yolov5 one and the other is custom made by us. We try to keep the requirements.txt as close as possible to what they have there. So the 2nd temporary workaround might be fine for now.

Diewertje11 commented 1 year ago

Okej, I will implement this!