Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic install not working on Linux #171

Closed
mb3152 opened this issue Jan 26, 2017 · 24 comments
Closed

Basic install not working on Linux #171

mb3152 opened this issue Jan 26, 2017 · 24 comments

Comments

@mb3152
Copy link

mb3152 commented Jan 26, 2017

Using a fresh install of Anacondas on a 64-bit CentOS linux. I can't get this thing to work.

nx9[~]> ipython
Python 2.7.12 |Anaconda 4.2.0 (64-bit)| (default, Jul  2 2016, 17:42:40) 
Type "copyright", "credits" or "license" for more information.

IPython 5.1.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: from surfer import Brain

In [2]: brain = Brain("fsaverage", "lh", "inflated")
Xlib:  extension "NV-GLX" missing on display "localhost:10.0".
ERROR: In /home/ilan/minonda/conda-bld/work/VTK-6.3.0/Rendering/OpenGL/vtkXOpenGLRenderWindow.cxx, line 633
vtkXOpenGLRenderWindow (0x476c490): Cannot create GLX context.  Aborting.

Aborted

If I do:

nx9[~]> ipython --gui qt
Python 2.7.12 |Anaconda 4.2.0 (64-bit)| (default, Jul  2 2016, 17:42:40) 
Type "copyright", "credits" or "license" for more information.

IPython 5.1.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: from surfer import Brain
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-1-29ecdfb526c5> in <module>()
----> 1 from surfer import Brain

/home/despoB/mb3152/anaconda2/lib/python2.7/site-packages/pyface/qt/__init__.py in prepare_pyqt4()
     15     # Set PySide compatible APIs.
     16     import sip
---> 17     sip.setapi('QDate', 2)
     18     sip.setapi('QDateTime', 2)
     19     sip.setapi('QString', 2)

ValueError: API 'QDate' has already been set to version 1
@mb3152 mb3152 changed the title Basic install not working on Unix Basic install not working on Linux Jan 26, 2017
@mwaskom
Copy link
Member

mwaskom commented Jan 26, 2017

Are you sshing into the linux system from a Mac?

@mb3152
Copy link
Author

mb3152 commented Jan 26, 2017

Yes

ssh -Y -C

@mwaskom
Copy link
Member

mwaskom commented Jan 26, 2017

This is a tricky issue that I don't fully understand, but I believe that it has to do with a limitation in XQuartz for displaying opengl graphics. It used to not be possible, and may or may not be possible in the latest version of XQuartz if you set some OSX defaults (I have not ever gotten it to work, but I think it is now claimed to).

I will try to track down what I read to come about this understanding last fall, but if that helps get you started please do some research and share what you find.

@mb3152
Copy link
Author

mb3152 commented Jan 26, 2017

I only found out that the latest XQuartz is supposed to support OpenGL graphics. I looked at my preferences, but I did not see anything relevant.

@mwaskom
Copy link
Member

mwaskom commented Jan 26, 2017

I think you need to set this parameter and probably restart your mac: http://www.hoffman2.idre.ucla.edu/access/x11_forwarding/#Notes_for_XQuartz_users

@mb3152
Copy link
Author

mb3152 commented Jan 26, 2017

In [1]: from surfer import Brain
In [2]: brain = Brain("fsaverage", "lh", "inflated")
Xlib: extension "NV-GLX" missing on display "localhost:10.0".

I still get that error, but the window comes up. But it's all brown.

@mwaskom
Copy link
Member

mwaskom commented Jan 26, 2017

Unfortunately I'm really not sure, like I said I've never actually gotten it to work. If you can create a simple self-contained example using mayavi directly, it might be worth asking over there as there will be a broader audience and you might be more likely to reach someone with the relevant lower-level graphics knowledge. Please report back if you do solve the problem.

@mb3152
Copy link
Author

mb3152 commented Jan 26, 2017

Okay. Well, I still have issues running it locally on my Mac.

`In [1]: from surfer import Brain

In [2]: brain = Brain("fsaverage", "lh", "inflated")
ERROR:root:An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line string', (1, 0))


ImportError Traceback (most recent call last)
in ()
----> 1 brain = Brain("fsaverage", "lh", "inflated")

/Users/Maxwell/anaconda2/lib/python2.7/site-packages/surfer/viz.pyc in init(self, subject_id, hemi, surf, curv, title, cortex, size, background, foreground, figure, subjects_dir, views, show_toolbar, offscreen, config_opts)
393 self._set_window_properties(size, background, foreground)
394 figures, _v = _make_viewer(figure, n_row, n_col, title,
--> 395 self._scene_size, offscreen)
396 self._figures = figures
397 self._v = _v

/Users/Maxwell/anaconda2/lib/python2.7/site-packages/surfer/viz.pyc in _make_viewer(figure, n_row, n_col, title, scene_size, offscreen)
210 # Triage: don't make TraitsUI if we don't have to
211 if n_row == 1 and n_col == 1:
--> 212 figure = mlab.figure(title, size=(w, h))
213 mlab.clf(figure)
214 figures = [[figure]]

/Users/Maxwell/anaconda2/lib/python2.7/site-packages/mayavi/tools/figure.pyc in figure(figure, bgcolor, fgcolor, engine, size)
62 else:
63 if engine is None:
---> 64 engine = get_engine()
65 if figure is None:
66 name = max(__scene_number_list) + 1

/Users/Maxwell/anaconda2/lib/python2.7/site-packages/mayavi/tools/engine_manager.pyc in get_engine(self)
95 if e.class.name == 'Engine']
96 if len(suitable) == 0:
---> 97 return self.new_engine()
98 else:
99 # Return the most engine add to the list most recently.

/Users/Maxwell/anaconda2/lib/python2.7/site-packages/mayavi/tools/engine_manager.pyc in new_engine(self)
140 options.
141 """
--> 142 check_backend()
143 if options.backend == 'envisage':
144 from mayavi.plugins.app import Mayavi

/Users/Maxwell/anaconda2/lib/python2.7/site-packages/mayavi/tools/engine_manager.pyc in check_backend()
47 wxPython: http://www.wxpython.org/
48 PyQT: http://www.riverbankcomputing.co.uk/software/pyqt/intro
---> 49 ''')
50
51

ImportError: Could not import backend for traits


Make sure that you have either the TraitsBackendWx or the TraitsBackendQt
projects installed. If you installed Mayavi with easy_install, try
easy_install <pkg_name>. easy_install Mayavi[app] will also work.

If you performed a source checkout, be sure to run 'python setup.py install'
in Traits, TraitsGUI, and the Traits backend of your choice.

Also make sure that either wxPython or PyQT is installed.
wxPython: http://www.wxpython.org/
PyQT: http://www.riverbankcomputing.co.uk/software/pyqt/intro`

@mb3152
Copy link
Author

mb3152 commented Jan 26, 2017

When I try doing those installs, it totally messes up my other packages.

@mb3152
Copy link
Author

mb3152 commented Jan 26, 2017

okay, I got wxPython to work without totally wrecking my library.

However, now I am getting an error while running mri_vol2surf. It claims it failed at the command line, but if I go run it on the command line, it runs fine...

The return code is "-6"
error is : 'dyld: lazy symbol binding failed: Symbol not found: ___emutls_get_address\n Referenced from: /Applications/freesurfer/bin/../lib/gcc/lib/libgomp.1.dylib\n Expected in: /usr/lib/libSystem.B.dylib\n\ndyld: Symbol not found: ___emutls_get_address\n Referenced from: /Applications/freesurfer/bin/../lib/gcc/lib/libgomp.1.dylib\n Expected in: /usr/lib/libSystem.B.dylib\n\n'

@mwaskom
Copy link
Member

mwaskom commented Jan 27, 2017

Probably your relevant environment variables aren't set properly in the session where you're running PySurfer?

@mb3152
Copy link
Author

mb3152 commented Jan 27, 2017

hmm how would I check out that / change it?

@mwaskom
Copy link
Member

mwaskom commented Jan 27, 2017

os.environ

@mb3152
Copy link
Author

mb3152 commented Jan 27, 2017 via email

@mwaskom
Copy link
Member

mwaskom commented Jan 27, 2017

I don't know because I've never seen that error and I'm not even sure exactly what you're trying to do or how you're doing it. But if something works in one environment and not in another, it might be good to figure out what differs between the environments.

However if you can use mri_vol2surf outside of pysurfer then you can just read in the surface files—no need to use project_volume_data (as I assume you are doing).

@mb3152
Copy link
Author

mb3152 commented Jan 27, 2017

Actually, this was a Freesurfer / MacOS issue. One has to disable System_Integrity_Protection. For whatever reason, the permissions are different in ipython than at the command line. Do you know an easier fix than disabling System_Integrity_Protection? Perhaps I could give ipython a different type of access or something?

@mwaskom
Copy link
Member

mwaskom commented Jan 27, 2017

I've never heard of that. How are you using ipython if not invoking it from the command line?

@mb3152
Copy link
Author

mb3152 commented Jan 27, 2017 via email

@mwaskom
Copy link
Member

mwaskom commented Jan 27, 2017

Ah, this sort of helpful feature is why I've resisted upgrading from 10.9

@mb3152
Copy link
Author

mb3152 commented Jan 27, 2017 via email

@mwaskom
Copy link
Member

mwaskom commented Jan 27, 2017

Just to be clear is the issue only when you're using surfer.project_volume_data?

@mb3152
Copy link
Author

mb3152 commented Jan 27, 2017 via email

@mwaskom
Copy link
Member

mwaskom commented Jan 27, 2017

I don't know how to solve the macos problem but this did make me realize that it is annoying to debug problems with project_volume_data when you can't see the mri_vol2surf output, hence #172

@larsoner
Copy link
Contributor

I had this problem on OSX, too. The fix that works for me is in #194. Turns out OSX does some silliness with DYLD_LIBRARY_PATH that we can fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants