fail to run uber_subject.py- fail to import PyQt4.QtGui

Hi, I failed to run it. the error message is

**** failed to import PyQt4.QtGui ****

PyQt4 must be installed to run the uber_subject.py GUI
→ see the output of: uber_subject.py -help_install

I used this command in t-shell:
echo ‘setenv PYTHONPATH /sw/lib/qt4-mac/lib/python2.7/site-packages/’ >> ~/.cshrc

The check all report is shown below. I wonder what the problem is. Thanks you very much!!

architecture: 64bit
system: Darwin
release: 16.7.0
version: Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64
distribution: 10.12.6 x86_64
number of CPUs: 4
apparent login shell: tcsh
shell RC file: .cshrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni : /Users/wenkang/abin/afni
afni version : Precompiled binary macosx_10.7_local: May 12 2017
: AFNI_17.1.05
AFNI_version.txt : AFNI_17.1.05, macosx_10.7_local, May 12 2017
which python : /usr/bin/python
python version : 2.7.10
which R : /usr/local/bin/R
R version : R version 3.4.1 (2017-06-30) – “Single Candle”
which tcsh : /bin/tcsh

instances of various programs found in PATH:
afni : 1 (/Users/wenkang/abin/afni)
R : 1 (/Library/Frameworks/R.framework/Versions/3.4/Resources/bin/R)
python : 1 (/usr/bin/python)
python2 : 0
python3 : 1 (/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6)

** have python3 but not python2

testing ability to start various programs…
afni : success
suma : success
3dSkullStrip : success
uber_subject.py : success
3dAllineate : success
3dRSFC : success
SurfMesh : success

checking for R packages…
rPkgsInstall -pkgs ALL -check : FAILURE

    oo Warning: 
       These packages are not installed on the computer: afex!
    These packages are not installed on the computer: phia!
    These packages are not installed on the computer: snow!
    These packages are not installed on the computer: lme4!
    These packages are not installed on the computer: paran!
    These packages are not installed on the computer: psych!

checking for $HOME files…
.afnirc : found
.sumarc : missing
.afni/help/all_progs.COMP : found

------------------------------ python libs -------------------------------
++ module ‘PyQt4’ found at /sw/lib/qt4-mac/lib/python2.7/site-packages/PyQt4
++ module loaded: PyQt4

** have PyQt4, but cannot load QtCore, QtGui; error is:


Traceback (most recent call last):
File “”, line 1, in
ImportError: No module named sip


python binaries under /sw/bin:
/sw/bin/python (sym link to /sw/bin/python2.7)
/sw/bin/python2.7

-------------------------------- env vars --------------------------------
PATH = /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/TeX/texbin:/Users/wenkang/abin:/Users/wenkang/abin

PYTHONPATH = /sw/lib/qt4-mac/lib/python2.7/site-packages/

R_LIBS =
LD_LIBRARY_PATH =
DYLD_LIBRARY_PATH (sub-shell) = /opt/X11/lib/flat_namespace
DYLD_FALLBACK_LIBRARY_PATH (sub-shell) =

------------------------------ data checks -------------------------------
data dir : found AFNI_data6 under $HOME/Downloads
top history: … [rickr]: updated FT_white.nii w/out 16 (brain stem)
data dir : missing AFNI_demos
data dir : missing suma_demo
data dir : missing afni_handouts
atlas : found TT_N27+tlrc under /Users/wenkang/abin

------------------------------ OS specific -------------------------------
which brew : /usr/local/bin/brew
brew version : Homebrew 1.2.0

++ found PyQt4 under /sw/lib/qt4-mac/lib/python2.7/site-packages
++ found 1 dylib files under ‘/opt/X11/lib/flat_namespace’
– found ‘libXt’ dylib files:
/opt/X11/lib/flat_namespace/libXt.6.dylib
– recent OS X, cannot check DYLD_LIBRARY_PATH in cur shell, cheating …
++ found evar DYLD_LIBRARY_PATH = /opt/X11/lib/flat_namespace

========================= summary, please fix: =========================

  • missing R packages (see rPkgsInstall)
  • consider running “suma -update_env” for .sumarc
  • check for partial install of PyQt4
  • insufficient data for AFNI bootcamp
  • consider adding /sw/lib/qt4-mac/lib/python2.7/site-packages to PYTHONPATH
  • consider installing gcc under homebrew
  • consider installing glib under homebrew

Hello,

I think you just need to put /sw/bin at the front of your PATH.
Edit your .cshrc file so that /sw/bin is the first directory, and
either source it or log out and log back in.

  • rick

I have a similar problem and wasn’t able to access uber_subject.py with a similar error message. After reading the message board, I also tried adding /sw/bin in front of the PYTHONPATH; however, to no avail. Specifically, within my .cshrc, the command is “setenv PYTHONPATH /sw/bin/usr/local/lib/python2.7/site-packages”. Below is the output from running the afni system check. Any help is greatly appreciated, Thank you!

-------------------------------- general ---------------------------------
architecture: 64bit
system: Darwin
release: 16.7.0
version: Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64
distribution: 10.12.6 x86_64
number of CPUs: 4
apparent login shell: tcsh
shell RC file: .cshrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni : /Users/epongpipat/abin/afni
afni version : Precompiled binary macosx_10.7_Intel_64: Sep 12 2017
: AFNI_17.2.13
AFNI_version.txt : AFNI_17.2.13, macosx_10.7_Intel_64, Sep 12 2017
which python : /usr/bin/python
python version : 2.7.10
which R : /usr/local/bin/R
R version : R version 3.4.1 (2017-06-30) – “Single Candle”
which tcsh : /bin/tcsh

instances of various programs found in PATH:
afni : 1 (/Users/epongpipat/abin/afni)
R : 1 (/Library/Frameworks/R.framework/Versions/3.4/Resources/bin/R)
python : 1 (/usr/bin/python)
python2 : 1 (/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/bin/python2.7)
python3 : 1 (/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/bin/python3.6)

testing ability to start various programs…
afni : success
suma : success
3dSkullStrip : success
uber_subject.py : success
3dAllineate : success
3dRSFC : success
SurfMesh : success
3dClustSim : success

checking for R packages…
rPkgsInstall -pkgs ALL -check : success

checking for $HOME files…
.afnirc : found
.sumarc : found
.afni/help/all_progs.COMP : found

------------------------------ python libs -------------------------------
++ module ‘PyQt4’ found at /usr/local/lib/python2.7/site-packages/PyQt4
++ module loaded: PyQt4

** have PyQt4, but cannot load QtCore, QtGui; error is:


Traceback (most recent call last):
File “”, line 1, in
ImportError: cannot import name QtCore


-------------------------------- env vars --------------------------------
PATH = /usr/local/sbin:/usr/local/fsl/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/epongpipat/abin:/Applications/MplusDemo

PYTHONPATH = /sw/bin/usr/local/lib/python2.7/site-packages

R_LIBS =
LD_LIBRARY_PATH =
DYLD_LIBRARY_PATH (sub-shell) =
DYLD_FALLBACK_LIBRARY_PATH (sub-shell) = /Users/epongpipat/abin

------------------------------ data checks -------------------------------
data dir : found AFNI_data6 under $HOME
top history: …ickr]: added PPI/run.ppi.example.txt, ppi.sample.dir
data dir : found AFNI_demos under $HOME
top history: 26 Sep 2014 [ziad] : added Do_11 to FATCAT_DEMO
data dir : found suma_demo under $HOME
top history: …/SUMA_data/Build_tmp on Wed Aug 20 10:04:23 EDT 2014
data dir : found afni_handouts under $HOME
atlas : found TT_N27+tlrc under /Users/epongpipat/abin

------------------------------ OS specific -------------------------------
which brew : /usr/local/bin/brew
brew version : Homebrew 1.3.2

++ found PyQt4 under /usr/local/lib/python2.7/site-packages
++ found valid link /usr/local/lib/libgomp.1.dylib
to /usr/local/Cellar/gcc/6.1.0/lib/gcc/6/libgomp.1.dylib
++ found valid link /usr/local/lib/libglib-2.0.dylib
to …/Cellar/glib/2.48.1/lib/libglib-2.0.dylib

========================= summary, please fix: =========================

  • check for partial install of PyQt4
  • consider adding /usr/local/lib/python2.7/site-packages to PYTHONPATH

You do not seem to have anything installed via fink, but
via homebrew. Try setting PYTHONPATH as specified at the
end of that system check output:

setenv PYTHONPATH /usr/local/lib/python2.7/site-packages

You might also need to logout and log back in. I see that
/usr/local/bin is before /usr/bin in your PATH, but python
seems to be coming from /usr/bin.

  • rick

Thanks, Rick, I installed fink, and uber_subject.py works now. Thanks!

That is great, thanks for the update!

  • rick