nipy / PySurfer

Cortical neuroimaging visualization in Python
https://pysurfer.github.io/
BSD 3-Clause "New" or "Revised" License
239 stars 98 forks source link

RuntimeError: No pyface.toolkits plugin could be loaded for qt4 (OSX) #264

Open mattvan83 opened 5 years ago

mattvan83 commented 5 years ago

Hello,

After having install PySurfer according guidelines on OSX 10, I wanted to run the simple plot_basics.py example and got this error:

python plot_basics.py 
Traceback (most recent call last):
  File "plot_basics.py", line 8, in <module>
    from surfer import Brain
  File "/Users/mattvan83/anaconda/envs/PySurf/lib/python3.6/site-packages/surfer/__init__.py", line 1, in <module>
    from .viz import Brain, TimeViewer  # noqa
  File "/Users/mattvan83/anaconda/envs/PySurf/lib/python3.6/site-packages/surfer/viz.py", line 13, in <module>
    from mayavi import mlab
  File "/Users/mattvan83/anaconda/envs/PySurf/lib/python3.6/site-packages/mayavi/mlab.py", line 15, in <module>
    from mayavi.core.common import process_ui_events
  File "/Users/mattvan83/anaconda/envs/PySurf/lib/python3.6/site-packages/mayavi/core/common.py", line 21, in <module>
    from pyface import api as pyface
  File "/Users/mattvan83/anaconda/envs/PySurf/lib/python3.6/site-packages/pyface/api.py", line 17, in <module>
    from .about_dialog import AboutDialog
  File "/Users/mattvan83/anaconda/envs/PySurf/lib/python3.6/site-packages/pyface/about_dialog.py", line 19, in <module>
    from .toolkit import toolkit_object
  File "/Users/mattvan83/anaconda/envs/PySurf/lib/python3.6/site-packages/pyface/toolkit.py", line 27, in <module>
    toolkit = toolkit_object = find_toolkit('pyface.toolkits')
  File "/Users/mattvan83/anaconda/envs/PySurf/lib/python3.6/site-packages/pyface/base_toolkit.py", line 263, in find_toolkit
    return import_toolkit(ETSConfig.toolkit, entry_point)
  File "/Users/mattvan83/anaconda/envs/PySurf/lib/python3.6/site-packages/pyface/base_toolkit.py", line 227, in import_toolkit
    raise RuntimeError(msg)
RuntimeError: No pyface.toolkits plugin could be loaded for qt4

I used conda environment and tried many different installations of package without any success.

Anybody has a solution?

Best, Matthieu

larsoner commented 4 years ago

Can you try also doing:

export QT_API=pyqt

To see if it helps?

Can you do:

$ python -c "from PyQt5 import QtCore"

on your system? If not, then you probably need to pip install pyqt5 or so to get the PyQt5 toolkit going.

mwaskom commented 4 years ago

I'm not sure the getting started advice we have reflects current best practices with the dependency versions you get from normal channels.

I wrote this a little while back: https://gist.github.com/mwaskom/5464accbdf387b3309520fa9db8837ae

IIRC, conda does now install a mayavi that works better, though