NameError: global name 'rconfig' is not defined

Issue #233 resolved
Gachon University created an issue

I'm trying to install rpy2 on our cluster. I got an error while I was installing rpy2.

The error massage was as follows:

[root@lggm recapseg-1.4.0.0]# pip install rpy2
Downloading/unpacking rpy2
  Downloading rpy2-2.5.0.tar.gz (163kB): 163kB downloaded
  Running setup.py (path:/state/partition1/tmp/pip_build_root/rpy2/setup.py) egg_info for package rpy2
    R version 3.0.2 (2013-09-25) -- "Frisbee Sailing"
    /usr/local/lib64/R/bin/R CMD config --ldflags
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/state/partition1/tmp/pip_build_root/rpy2/setup.py", line 271, in <module>
        ri_ext = getRinterface_ext()
      File "/state/partition1/tmp/pip_build_root/rpy2/setup.py", line 196, in getRinterface_ext
        ldf = shlex.split(' '.join(rexec.cmd_config('--ldflags')))
      File "/state/partition1/tmp/pip_build_root/rpy2/setup.py", line 137, in cmd_config
        output = rconfig.strip()
    NameError: global name 'rconfig' is not defined
    Complete output from command python setup.py egg_info:
    R version 3.0.2 (2013-09-25) -- "Frisbee Sailing"

/usr/local/lib64/R/bin/R CMD config --ldflags

Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "/state/partition1/tmp/pip_build_root/rpy2/setup.py", line 271, in <module>

    ri_ext = getRinterface_ext()

  File "/state/partition1/tmp/pip_build_root/rpy2/setup.py", line 196, in getRinterface_ext

    ldf = shlex.split(' '.join(rexec.cmd_config('--ldflags')))

  File "/state/partition1/tmp/pip_build_root/rpy2/setup.py", line 137, in cmd_config

    output = rconfig.strip()

NameError: global name 'rconfig' is not defined

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /state/partition1/tmp/pip_build_root/rpy2
Storing debug log for failure in /root/.pip/pip.log

Please let me know what the problem is.

Comments (10)

  1. Laurent Gautier

    Hi, what would the current R release give ?

    Otherwise there is certainly an issue setup.py (it was refactored, and a call to function that is gone was left behind)

  2. idella5

    Build of rpy-2.5.0 (in gentoo) yielded

    ./rpy/rinterface/_rinterface.c:785:20: note: gstate was declared here
       PyGILState_STATE gstate;
                        ^
    x86_64-pc-linux-gnu-gcc -shared -Wl,-O1 -Wl,--as-needed -Wl,-O1 -Wl,--as-needed -march=athlon64 -pipe -fomit-frame-pointer -Wall -O2 -fno-strict-aliasing /mnt/gen2/TmpDir/portage/dev-python/rpy-2.5.0/work/rpy2-2.5.0-python2_7/temp.linux-x86_64-2.7/./rpy/rinterface/_rinterface.o -L/usr/lib64 -lR -lpcre -llzma -lbz2 -lz -lrt -ldl -lm -lpython2.7 -o /mnt/gen2/TmpDir/portage/dev-python/rpy-2.5.0/work/rpy2-2.5.0-python2_7/lib/rpy2/rinterface/_rinterface.so -Wl,--export-dynamic -fopenmp -Wl,-O1 -Wl,--as-needed -Wl,-O1 -Wl,--as-needed
    /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lR
    collect2: error: ld returned 1 exit status
    error: command 'x86_64-pc-linux-gnu-gcc' failed with exit status 1
    

    On basic investigation we have ascertained that the previous version (rpy-2.4.4) builds fine, the libR.so is there and found by the build of rpy-2.4.4 and is not being picked up in the new release of rpy-2.5.0. I believe these are the same pea in the one pod. All fingers point at the revamped setup.py

  3. Laurent Gautier

    @Iggm : there is tentative fix in the repository. Can you try installing the tip of the branch for rpy2-2.5.x to confirm that it is fixing your issue ?

    For example:

    pip install https://bitbucket.org/lgautier/rpy2/get/version_2.5.x.tar.gz
    
  4. Laurent Gautier

    @idella5 : this seems to be a different issue than the one originally reported (although the new setup.py might have introduced both of them). Can you move this to a separated issue (easier to handle / follow-up). Thanks.

  5. Log in to comment