OpenSfM icon indicating copy to clipboard operation
OpenSfM copied to clipboard

Unable to run, attempted to make changes but still failed

Open Qiii77 opened this issue 1 year ago • 2 comments

back (most recent call last): File "D:\opensourceProject\OpenSfM\annotation_gui_gcp\main.py", line 11, in from annotation_gui_gcp.lib import GUI File "D:\opensourceProject\OpenSfM\annotation_gui_gcp\lib\GUI.py", line 14, in from opensfm import dataset File "D:\opensourceProject\OpenSfM\opensfm_init_.py", line 2, in from opensfm import pybundle ImportError: cannot import name 'pybundle' from partially initialized module 'opensfm' (most likely due to a circular import)

Qiii77 avatar Mar 15 '24 08:03 Qiii77

I also had this issue. Solved it by insert the following lines in annotation_gui_gcp/main.py before the line from annotation_gui_gcp.lib import GUI:

# Add opensfm directory to path
import os
opensfm_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
import sys
sys.path.append(opensfm_dir)

MaxWinklh2908 avatar Mar 18 '24 09:03 MaxWinklh2908

I also had this issue. Solved it by insert the following lines in annotation_gui_gcp/main.py before the line from annotation_gui_gcp.lib import GUI:

# Add opensfm directory to path
import os
opensfm_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
import sys
sys.path.append(opensfm_dir)

I tried according to your method, but the result is still the same as before and cannot run. May require some other suggestions,thank you very much.

Qiii77 avatar Mar 20 '24 06:03 Qiii77