nipy / PySurfer

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

Mac 10.11.6 installation problem #168

Closed anbai106 closed 7 years ago

anbai106 commented 7 years ago

Hello, I am new to pysurfer, and I installed it by using pip install pysurfer, and i have anaconda on my mac, I followed the installation page from here https://pysurfer.github.io/install.html I installed the mayavi package by pip, not conda install, because conda install will degenerate some packages in my conda environment, the others packages are satisfied, and i set the env variable: export QT_API=pyqtI

I run the tutorial code: https://pysurfer.github.io/examples/plot_parc_values.html#example-plot-parc-values-py

And I got some errros:

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 . 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

I checked out that i have pyqt, without error when doing import PyQt4

Can somebody helps me, I did not find a forum to ask this question, sorry if I put it in the wrong place.

Thanks in advance

Hao

agramfort commented 7 years ago

are you running python 2 or 3?

anbai106 commented 7 years ago

Thanks for your rapid reply, im using python2.7

agramfort commented 7 years ago

then just use

conda install mayavi

that's the safest option. I just add this before starting python:

export ETS_TOOLKIT=qt4 export QT_API=pyqt

anbai106 commented 7 years ago

Ok, after i add export ETS_TOOLKIT=qt4 to my zshrc, the errors changed, right now, it is: ImportError: cannot import name QKeySequence

I am not familiar with pyqt, and google does not answer too much

i dont wanna use conda install because if will degenerate some of my installed packages which are not compatible with mayavi. and this will influence my other projects..

here is the info about the pyqt

`In [3]: print("Qt version:", QT_VERSION_STR) ('Qt version:', '4.8.7')

In [4]: from PyQt4.Qt import QKeySequence`

any idea??? Thanks in advance

anbai106 commented 7 years ago

I think the problem is here, I reinstalled mayavi with conda, and when I run gui gt in ipython: i got some lib link error: gui qt ERROR:root:dlopen(/Users/junhao.wen/anaconda/lib/python2.7/site-packages/PyQt4/QtGui.so, 2): Library not loaded: @rpath/libpng16.16.dylib Referenced from: /Users/junhao.wen/anaconda/lib/libQtGui.4.8.7.dylib Reason: Incompatible library version: libQtGui.4.dylib requires version 39.0.0 or later, but libpng16.16.dylib provides version 34.0.0

I dont know why, before i used brew install qt , and i uninstalled it and the error still there

anbai106 commented 7 years ago

Hello, i solve this problem, because there is some conflict between libpng and qt, so i reinstall everything in the newest version. Thank you very much, you can just close this:)