Forum

Author Topic: Headless mode import  (Read 2297 times)

bbbares

  • Newbie
  • *
  • Posts: 21
    • View Profile
Headless mode import
« on: May 22, 2020, 11:32:34 PM »
I am looking to run my metashape script in a docker container and when I run it I receive this error:
Code: [Select]
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/local/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/appuser/ms_pipeline/sweepS3.py", line 10, in <module>
    from ms_pipeline.ms_workflow import runmetashape
  File "/home/appuser/ms_pipeline/ms_workflow/runmetashape.py", line 7, in <module>
    import Metashape as Ms
  File "/usr/local/lib/python3.7/site-packages/Metashape/__init__.py", line 3, in <module>
    from .Metashape import *
ImportError: libGL.so.1: cannot open shared object file: No such file or directory
From preliminary research it seems that this it related to the GUI. For my purposes the GUI is not necessary is there a way I can run the module in headless mode forgoing needs for the GUI? If not please let me know. Thanks.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14839
    • View Profile
Re: Headless mode import
« Reply #1 on: May 24, 2020, 08:54:25 PM »
Hello bbbares,

Does it help, if you run the script using -platform offscreen command line parameter?

Code: [Select]
./metashape.sh -platform offscreen -r script.py
Or whether you are using Metashape stand alone module? If so, then can you reproduce the problem just by using the simple script with "import Metashape" line alone?
« Last Edit: May 24, 2020, 08:56:05 PM by Alexey Pasumansky »
Best regards,
Alexey Pasumansky,
Agisoft LLC

bbbares

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Headless mode import
« Reply #2 on: May 26, 2020, 04:47:53 PM »
I am using the standalone module. The error arises when my script attempts to "import Metashape".
« Last Edit: May 26, 2020, 09:05:54 PM by bbbares »

EE

  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: Headless mode import
« Reply #3 on: January 04, 2021, 02:38:11 PM »
Sorry for checking in on an old thread, but did you find a solution?