mapillary / OpenSfM

Open source Structure-from-Motion pipeline
https://www.opensfm.org/
BSD 2-Clause "Simplified" License
3.37k stars 856 forks source link

Unable to run, attempted to make changes but still failed #1046

Open Qiii77 opened 6 months ago

Qiii77 commented 6 months ago

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)

MaxWinklh2908 commented 6 months ago

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)
Qiii77 commented 6 months ago

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.