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

Installation instructions do not work on Mac OSX #5778

Closed
noahbenson opened this issue Dec 6, 2018 · 5 comments
Closed

Installation instructions do not work on Mac OSX #5778

noahbenson opened this issue Dec 6, 2018 · 5 comments

Comments

@noahbenson
Copy link

I recently had to reinstall MNE on Mac OSX (Mojave), and to do so I followed the installation instructions exactly. They appeared to work, but when I started testing out the installation it became clear that the graphics are not working.

The problem appears to be with mayavi/pyqt/vtk, and similar bug reports have been documented in many projects, including mne. None of the proposed solutions have made any difference as far as I can tell, however.

Info and Reproduction:

(mne) $ ipython
Python 3.6.6 | packaged by conda-forge | (default, Jul 26 2018, 09:55:02) 
Type 'copyright', 'credits' or 'license' for more information
IPython 6.5.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import mne

In [2]: mne.sys_info()
Platform:      Darwin-18.0.0-x86_64-i386-64bit
Python:        3.6.6 | packaged by conda-forge | (default, Jul 26 2018, 09:55:02)  [GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)]
Executable:    /Users/nben/Library/miniconda2/envs/mne/bin/python
CPU:           i386: 8 cores
Memory:        48.0 GB

mne:           0.17.0
numpy:         1.15.1 {blas=mkl_rt, lapack=mkl_rt}
scipy:         1.1.0
matplotlib:    2.2.3 {backend=MacOSX}

sklearn:       0.19.1
nibabel:       2.3.0
mayavi:        4.7.0.dev0 {qt_api=pyqt5, PyQt5=5.9.2}
cupy:          Not found
pandas:        0.23.4
dipy:          0.14.0

In [3]: from mayavi import mlab

In [4]: %gui qt

In [5]: mlab.test_plot3d()
Out[5]: <mayavi.modules.surface.Surface at 0x135f0d620>

image

(The visualization window simply hangs.)

Is there something obviously wrong with my configuration? Has anyone managed to make this work in recent versions of Mac OSX?

@larsoner
Copy link
Member

larsoner commented Dec 6, 2018

Does it "un-hang" if you do:

>>> mlab.process_ui_events()

If so then it's just a problem with the GUI event loop not running, you might need %gui qt.

If that works, we should probably change the note about this in the installation instructions to be non-Windows specific. Can you open a PR to do this?

@larsoner
Copy link
Member

larsoner commented Dec 6, 2018

.. oh you have the % gui qt in there. Weird. Let me know how the process_ui_events goes and if it works, we can look into why it's not actually starting the event loop.

You can check to see if it is by doing:

import matplotlib.pyplot as plt
fig, axes = plt.subplots()

and seeing if that window is responsive.

@larsoner
Copy link
Member

larsoner commented Dec 6, 2018

Ahh I see a hint. You are running pyqt 5.9.2. That means this line in the installation instructions did not work:

$ pip install --upgrade "pyqt5>=5.10"

Are you sure you ran it? Can you try running it again and tell us the output?

@noahbenson
Copy link
Author

Yeah, sorry, I followed them initially then tried to fix things myself by upgrading/installing/downgrading various packages based on other answers, then wrote the post. The same thing happens in just about every scenario (except in some where the Python kernel outright crashes on from mayavi import mlab).

That said, I just cleared my mne environment and reran the install instructions--same problem. But I noticed a warning about my sha256 hashes not matching with the Mayavi package during install, so I deleted the cache files and reran the install instructions and now things are working fine. So I'm going to guess that this had nothing to do with MNE :-)

Thanks!

@larsoner
Copy link
Member

larsoner commented Dec 6, 2018

Weird -- yes, sounds like a pip caching problem. Maybe we should add a note to the troubleshooting guide about telling pip not to use cache (or deleting the cache) if things don't work?

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

2 participants