OpenSfM icon indicating copy to clipboard operation
OpenSfM copied to clipboard

GCP Annotation tool - ModuleNotFoundError: No module named 'annotation_gui_gcp'

Open treecon opened this issue 2 years ago • 3 comments

I have installed OpenSfM in Ubuntu 22.04. Cloned commit is d1165f9d522aee41f825be464a7e232286f529f1.

bin/opensfm_run_all & bin/opensfm work OK.

I have a problem installing annotation tool.

I follow the instructions here: https://opensfm.org/docs/annotation_tool.html When i run "python annotation_gui_gcp/main.py data/berlin" I get the following:

Traceback (most recent call last):
  File "/home/konstantinos/Desktop/opensfm/OpenSfM/annotation_gui_gcp/main.py", line 10, in <module>
    from annotation_gui_gcp.lib import GUI
ModuleNotFoundError: No module named 'annotation_gui_gcp'

Any ideas?

treecon avatar Jul 19 '22 09:07 treecon

Can you try adding the OpenSfM installation directory to your Python path?

fabianschenk avatar Jul 19 '22 14:07 fabianschenk

I added OpenSfM directory to Python path but didn't work.

When I run python annotation_gui_gcp/main.py data/berlin I get:

Command 'python' not found, did you mean:
  command 'python3' from deb python3
  command 'python' from deb python-is-python3

If I run the same command with python3 instead of python (python3 annotation_gui_gcp/main.py data/berlin) I get:

Traceback (most recent call last):
  File "/home/konstantinos/Desktop/opensfm/OpenSfM/annotation_gui_gcp/main.py", line 10, in <module>
    from annotation_gui_gcp.lib import GUI
  File "/home/konstantinos/Desktop/opensfm/OpenSfM/annotation_gui_gcp/lib/GUI.py", line 9, in <module>
    from annotation_gui_gcp.lib.views.cad_view import CADView
  File "/home/konstantinos/Desktop/opensfm/OpenSfM/annotation_gui_gcp/lib/views/cad_view.py", line 6, in <module>
    import rasterio
ModuleNotFoundError: No module named 'rasterio'

treecon avatar Jul 20 '22 13:07 treecon

Hi @treecon ,

So the issue likely was with your path settings. If there's a ModuleNotFoundError, then just install the module. In your case, the rasterio(see this link). Do this for all the missing packages.

You might also need to run python3 -m pip install rasterio instead of pip install rasterio.

fabianschenk avatar Jul 21 '22 08:07 fabianschenk