TypeError: 'NoneType' object is not iterable

Issue #246 resolved
Robert Nichols
created an issue

When I try to install rpy2 with Pip I keep getting this error "TypeError: 'NoneType' object is not iterable". It further goes on to explain that the command python setup.py egg_info failed with error code 1. I have really no idea how to fix this error. I am using python 2.7 and I am using R 'Good Sport' which is version 3.0.1. I have also tried to install rpy2 with python 3.4 but I get the same error. My OS is OS X Yosemite but this error was also seen when I ran Mavericks. Thanks for the help

Comments (6)

  1. Matteo Visconti

    Same here with Python 2.7.8, Mac OS X 10.10.1, and R 3.0.2. I had to roll back to rpy2 2.4.4 for a successful installation.

    This is the traceback for the failing installation:

    Downloading from URL https://pypi.python.org/packages/source/r/rpy2/rpy2-2.5.2.tar.gz#md5=65f865ae50c223f44d058d7cddf0ff87 (from https://pypi.python.org/simple/rpy2/)
    ...Downloading rpy2-2.5.2.tar.gz (164kB): 164kB downloaded
      Running setup.py (path:/private/var/folders/gs/4v1cn8mj4n52qrr9r6xv4ckm0000gn/T/pip_build_contematto/rpy2/setup.py) egg_info for package rpy2
        Running command python setup.py egg_info
        R version 3.0.2 (2013-09-25) -- "Frisbee Sailing"
        /Library/Frameworks/R.framework/Resources/bin/R CMD config --ldflags
        /Library/Frameworks/R.framework/Resources/bin/R CMD config --cppflags
        Traceback (most recent call last):
          File "<string>", line 17, in <module>
          File "/private/var/folders/gs/4v1cn8mj4n52qrr9r6xv4ckm0000gn/T/pip_build_contematto/rpy2/setup.py", line 275, in <module>
            ri_ext = getRinterface_ext()
          File "/private/var/folders/gs/4v1cn8mj4n52qrr9r6xv4ckm0000gn/T/pip_build_contematto/rpy2/setup.py", line 208, in getRinterface_ext
            libraries.extend([x for x in args.l if x != 'R'])
        TypeError: 'NoneType' object is not iterable
        Complete output from command python setup.py egg_info:
        R version 3.0.2 (2013-09-25) -- "Frisbee Sailing"
    
    /Library/Frameworks/R.framework/Resources/bin/R CMD config --ldflags
    
    /Library/Frameworks/R.framework/Resources/bin/R CMD config --cppflags
    
    Traceback (most recent call last):
    
      File "<string>", line 17, in <module>
    
      File "/private/var/folders/gs/4v1cn8mj4n52qrr9r6xv4ckm0000gn/T/pip_build_contematto/rpy2/setup.py", line 275, in <module>
    
        ri_ext = getRinterface_ext()
    
      File "/private/var/folders/gs/4v1cn8mj4n52qrr9r6xv4ckm0000gn/T/pip_build_contematto/rpy2/setup.py", line 208, in getRinterface_ext
    
        libraries.extend([x for x in args.l if x != 'R'])
    
    TypeError: 'NoneType' object is not iterable
    
  2. Robert Nichols reporter

    Thanks so much, this let me install rpy2. The reason I am using this is for something called LeFSe and when I run it, I am getting an error message that looks like this, and I am wondering if you have any ideas on how to fix this.

    ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python3.4/site-packages/rpy2/rinterface/_rinterface.so, 2): Symbol not found: __Py_FalseStruct
    Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python3.4/site-packages/rpy2/rinterface/_rinterface.so
    Expected in: flat namespace
    in /Library/Frameworks/Python.framework/Versions/2.7/lib/python3.4/site-packages/rpy2/rinterface/_rinterface.so

  3. Laurent Gautier

    This is likely changes in R / R on OS X.

    The current rpy2 is designed the current R (latest is 3.1.2), and older R version (here the 3.0.0 series) might or might not work.

    A tentative fix is in e9e0bbd8db26 (and will be in the upcoming release rpy2-2.5.3)

  4. Log in to comment