GithubHelp home page GithubHelp logo

Comments (4)

ChristophKirst avatar ChristophKirst commented on July 26, 2024

This is a good point, we are working on a headless version for cluster computation that catches these types of errors.
Meanwhile you could simply move those imports from the top of the module into the routines that use them...

hope that helps.

Christoph

from clearmap2.

slitvinov avatar slitvinov commented on July 26, 2024

Meanwhile you could simply move those imports from the top of the module into the routines that use them...

I think it would work. I am trying to keep local changes at minimum.

I found that this line causes problems:
https://github.com/ChristophKirst/ClearMap2/blob/master/ClearMap/Visualization/Qt/DataViewer.py#L32

Can it be conditional?

if 'DISPLAY' in os.environ and not pg.QAPP: 
  pg.mkQApp()

from clearmap2.

ZachPenn avatar ZachPenn commented on July 26, 2024

I ran into the same issue. Since notebooks are utilized, perhaps using interactive jupyter notebook visualizations in lieu of gui would be an option.

from clearmap2.

ZachPenn avatar ZachPenn commented on July 26, 2024

My labmate came up with a potentially great solution that works in ClearMap2's current form when running from a remote, headless, Ubuntu setup. This provides a way to load the ClearMap.Environment in full without commenting out GUI dependencies. Additionally, it should allow the GUI to be displayed locally, though I haven't tested this extensively. Because it handles X11 window managers, I'm not sure this will work when running a windows setup locally. However, I was able to use it while running OSX locally.

In order to link a local window to a headless server to avoid ClearMap2 GUI dependency issues, we took the following route:

  • Install xpra (https://www.xpra.org/) on both remote/server and local computers
  • On the server, initiate an empty display port from the terminal: xpra start :X, where x is any integer. This step should persist, and will therefore only need to be redone if the server is stopped, or if xpra stop is called.
  • Add the following lines to the beginning of ClearMap, prior to importing the ClearMap.Environment:
import os
os.environ['DISPLAY'] = ':X'

Note that at this point all ClearMap modules can be loaded, but visualization steps will not work. The next step should allow the GUI to be generated locally

  • From your local terminal, attach the empty display port. When the GUI is subsequently called, it should display locally:
    xpra attach ssh://me@myserver/X

from clearmap2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.