pip install fails (on windows 8)

Issue #258 resolved
Mikolaj Magnuski
created an issue

I followed windows install instructions (setting up relevant environment variables etc.) I have R 3.1 but somewhen in the log / traceback there shows an info that R version may not be recent enough... (actually rexec.version ends up being int, while it should be string) The log/traceback is full of cygwin warning and culminates in installation error and pip exploding on UnicodeDecodeError during cleanup... I would very much like to install rpy2, but do not know how to get there from where I'm now :)

? pip install rpy2
Downloading/unpacking rpy2
  Downloading rpy2-2.5.4.tar.gz (164kB): 164kB downloaded
  Running setup.py egg_info for package rpy2
    R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet"
    Copyright (C) 2014 The R Foundation for Statistical Computing
    Platform: i386-w64-mingw32/i386 (32-bit)

    R is free software and comes with ABSOLUTELY NO WARRANTY.
    You are welcome to redistribute it under the terms of the
    GNU General Public License versions 2 or 3.
    For more information about these matters see
    http://www.gnu.org/licenses/.

    cygwin warning:
      MS-DOS style path detected: D:/Programy/R-3.1.2/etc/i386/Makeconf
      Preferred POSIX equivalent is: /cygdrive/d/Programy/R-3.1.2/etc/i386/Makeconf
      CYGWIN environment variable option "nodosfilewarning" turns off this warning.
      Consult the user's guide for more details about POSIX paths:
        http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
    cygwin warning:
      MS-DOS style path detected: D:/Programy/R-3.1.2/etc/i386/Makeconf
      Preferred POSIX equivalent is: /cygdrive/d/Programy/R-3.1.2/etc/i386/Makeconf
      CYGWIN environment variable option "nodosfilewarning" turns off this warning.
      Consult the user's guide for more details about POSIX paths:
        http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
    cygwin warning:
      MS-DOS style path detected: D:/Programy/R-3.1.2/etc/i386/Makeconf
      Preferred POSIX equivalent is: /cygdrive/d/Programy/R-3.1.2/etc/i386/Makeconf
      CYGWIN environment variable option "nodosfilewarning" turns off this warning.
      Consult the user's guide for more details about POSIX paths:
        http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
    cygwin warning:
      MS-DOS style path detected: D:/Programy/R-3.1.2/etc/i386/Makeconf
      Preferred POSIX equivalent is: /cygdrive/d/Programy/R-3.1.2/etc/i386/Makeconf
      CYGWIN environment variable option "nodosfilewarning" turns off this warning.
      Consult the user's guide for more details about POSIX paths:
        http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
    cygwin warning:
      MS-DOS style path detected: D:/Programy/R-3.1.2/etc/i386/Makeconf
      Preferred POSIX equivalent is: /cygdrive/d/Programy/R-3.1.2/etc/i386/Makeconf
      CYGWIN environment variable option "nodosfilewarning" turns off this warning.
      Consult the user's guide for more details about POSIX paths:
        http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
    cygwin warning:
      MS-DOS style path detected: D:/Programy/R-3.1.2/etc/i386/Makeconf
      Preferred POSIX equivalent is: /cygdrive/d/Programy/R-3.1.2/etc/i386/Makeconf
      CYGWIN environment variable option "nodosfilewarning" turns off this warning.
      Consult the user's guide for more details about POSIX paths:
        http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
    cygwin warning:
      MS-DOS style path detected: D:/Programy/R-3.1.2/etc/i386/Makeconf
      Preferred POSIX equivalent is: /cygdrive/d/Programy/R-3.1.2/etc/i386/Makeconf
      CYGWIN environment variable option "nodosfilewarning" turns off this warning.
      Consult the user's guide for more details about POSIX paths:
        http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
    cygwin warning:
      MS-DOS style path detected: D:/Programy/R-3.1.2/etc/i386/Makeconf
      Preferred POSIX equivalent is: /cygdrive/d/Programy/R-3.1.2/etc/i386/Makeconf
      CYGWIN environment variable option "nodosfilewarning" turns off this warning.
      Consult the user's guide for more details about POSIX paths:
        http://cygwin.com/cygwin-ug-net/using.html#using-pathnames

    D:\Programy\R-3.1.2\bin\R CMD config --ldflags
    D:\Programy\R-3.1.2\bin\R CMD config --cppflags

        Compilation parameters for rpy2's C components:
            include_dirs    = ['D:/Programy/R-3.1.2/include', 'D:/Programy/R-3.1.2/include/i386']
            library_dirs    = ['D:/Programy/R-3.1.2/bin/i386']
            libraries       = ['R', 'm']
            extra_link_args = []

    c:\users\miku~1\appdata\local\temp\pip_build_Mikuť\rpy2\setup.py:187: UserWarning: R did not seem to have the minimum required version number
      warnings.warn("R did not seem to have the minimum required version number")

    R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet"
    Copyright (C) 2014 The R Foundation for Statistical Computing
    Platform: i386-w64-mingw32/i386 (32-bit)

    R is free software and comes with ABSOLUTELY NO WARRANTY.
    You are welcome to redistribute it under the terms of the
    GNU General Public License versions 2 or 3.
    For more information about these matters see
    http://www.gnu.org/licenses/.


    Traceback (most recent call last):
      File "<string>", line 16, in <module>
      File "c:\users\miku~1\appdata\local\temp\pip_build_Mikuť\rpy2\setup.py", line 332, in <module>
        'rpy2': ['doc/source/rpy2_logo.png', ]}
      File "D:\Python\Anaconda\lib\distutils\core.py", line 151, in setup
        dist.run_commands()
      File "D:\Python\Anaconda\lib\distutils\dist.py", line 953, in run_commands
        self.run_command(cmd)
      File "D:\Python\Anaconda\lib\distutils\dist.py", line 972, in run_command
        cmd_obj.run()
      File "<string>", line 14, in replacement_run
      File "D:\Python\Anaconda\lib\site-packages\setuptools-7.0-py2.7.egg\setuptools\command\egg_info.py", line 193, in find_sources
      File "D:\Python\Anaconda\lib\site-packages\setuptools-7.0-py2.7.egg\setuptools\command\egg_info.py", line 277, in run
      File "D:\Python\Anaconda\lib\site-packages\setuptools-7.0-py2.7.egg\setuptools\command\egg_info.py", line 306, in add_defaults
      File "D:\Python\Anaconda\lib\site-packages\setuptools-7.0-py2.7.egg\setuptools\command\sdist.py", line 185, in add_defaults
      File "D:\Python\Anaconda\lib\distutils\cmd.py", line 312, in get_finalized_command
        cmd_obj.ensure_finalized()
      File "D:\Python\Anaconda\lib\distutils\cmd.py", line 109, in ensure_finalized
        self.finalize_options()
      File "c:\users\miku~1\appdata\local\temp\pip_build_Mikuť\rpy2\setup.py", line 65, in finalize_options
        raise SystemExit("Error: R >= 2.8 required (and R told '%s')." %'.'.join(rexec.version))
    TypeError: sequence item 0: expected string, int found
    Complete output from command python setup.py egg_info:
    R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet"

Copyright (C) 2014 The R Foundation for Statistical Computing

Platform: i386-w64-mingw32/i386 (32-bit)



R is free software and comes with ABSOLUTELY NO WARRANTY.

You are welcome to redistribute it under the terms of the

GNU General Public License versions 2 or 3.

For more information about these matters see

http://www.gnu.org/licenses/.



cygwin warning:

  MS-DOS style path detected: D:/Programy/R-3.1.2/etc/i386/Makeconf

  Preferred POSIX equivalent is: /cygdrive/d/Programy/R-3.1.2/etc/i386/Makeconf

  CYGWIN environment variable option "nodosfilewarning" turns off this warning.

  Consult the user's guide for more details about POSIX paths:

    http://cygwin.com/cygwin-ug-net/using.html#using-pathnames

cygwin warning:

  MS-DOS style path detected: D:/Programy/R-3.1.2/etc/i386/Makeconf

  Preferred POSIX equivalent is: /cygdrive/d/Programy/R-3.1.2/etc/i386/Makeconf

  CYGWIN environment variable option "nodosfilewarning" turns off this warning.

  Consult the user's guide for more details about POSIX paths:

    http://cygwin.com/cygwin-ug-net/using.html#using-pathnames

cygwin warning:

  MS-DOS style path detected: D:/Programy/R-3.1.2/etc/i386/Makeconf

  Preferred POSIX equivalent is: /cygdrive/d/Programy/R-3.1.2/etc/i386/Makeconf

  CYGWIN environment variable option "nodosfilewarning" turns off this warning.

  Consult the user's guide for more details about POSIX paths:

    http://cygwin.com/cygwin-ug-net/using.html#using-pathnames

cygwin warning:

  MS-DOS style path detected: D:/Programy/R-3.1.2/etc/i386/Makeconf

  Preferred POSIX equivalent is: /cygdrive/d/Programy/R-3.1.2/etc/i386/Makeconf

  CYGWIN environment variable option "nodosfilewarning" turns off this warning.

  Consult the user's guide for more details about POSIX paths:

    http://cygwin.com/cygwin-ug-net/using.html#using-pathnames

cygwin warning:

  MS-DOS style path detected: D:/Programy/R-3.1.2/etc/i386/Makeconf

  Preferred POSIX equivalent is: /cygdrive/d/Programy/R-3.1.2/etc/i386/Makeconf

  CYGWIN environment variable option "nodosfilewarning" turns off this warning.

  Consult the user's guide for more details about POSIX paths:

    http://cygwin.com/cygwin-ug-net/using.html#using-pathnames

cygwin warning:

  MS-DOS style path detected: D:/Programy/R-3.1.2/etc/i386/Makeconf

  Preferred POSIX equivalent is: /cygdrive/d/Programy/R-3.1.2/etc/i386/Makeconf

  CYGWIN environment variable option "nodosfilewarning" turns off this warning.

  Consult the user's guide for more details about POSIX paths:

    http://cygwin.com/cygwin-ug-net/using.html#using-pathnames

cygwin warning:

  MS-DOS style path detected: D:/Programy/R-3.1.2/etc/i386/Makeconf

  Preferred POSIX equivalent is: /cygdrive/d/Programy/R-3.1.2/etc/i386/Makeconf

  CYGWIN environment variable option "nodosfilewarning" turns off this warning.

  Consult the user's guide for more details about POSIX paths:

    http://cygwin.com/cygwin-ug-net/using.html#using-pathnames

cygwin warning:

  MS-DOS style path detected: D:/Programy/R-3.1.2/etc/i386/Makeconf

  Preferred POSIX equivalent is: /cygdrive/d/Programy/R-3.1.2/etc/i386/Makeconf

  CYGWIN environment variable option "nodosfilewarning" turns off this warning.

  Consult the user's guide for more details about POSIX paths:

    http://cygwin.com/cygwin-ug-net/using.html#using-pathnames



D:\Programy\R-3.1.2\bin\R CMD config --ldflags

D:\Programy\R-3.1.2\bin\R CMD config --cppflags



    Compilation parameters for rpy2's C components:

        include_dirs    = ['D:/Programy/R-3.1.2/include', 'D:/Programy/R-3.1.2/include/i386']

        library_dirs    = ['D:/Programy/R-3.1.2/bin/i386']

        libraries       = ['R', 'm']

        extra_link_args = []



running egg_info

creating pip-egg-info\rpy2.egg-info

writing requirements to pip-egg-info\rpy2.egg-info\requires.txt

writing pip-egg-info\rpy2.egg-info\PKG-INFO

writing top-level names to pip-egg-info\rpy2.egg-info\top_level.txt

writing dependency_links to pip-egg-info\rpy2.egg-info\dependency_links.txt

writing manifest file 'pip-egg-info\rpy2.egg-info\SOURCES.txt'

c:\users\miku~1\appdata\local\temp\pip_build_Mikuť\rpy2\setup.py:187: UserWarning: R did not seem to have the minimum required version number

  warnings.warn("R did not seem to have the minimum required version number")

warning: manifest_maker: standard file '-c' not found



R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet"

Copyright (C) 2014 The R Foundation for Statistical Computing

Platform: i386-w64-mingw32/i386 (32-bit)



R is free software and comes with ABSOLUTELY NO WARRANTY.

You are welcome to redistribute it under the terms of the

GNU General Public License versions 2 or 3.

For more information about these matters see

http://www.gnu.org/licenses/.





Traceback (most recent call last):

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

  File "c:\users\miku~1\appdata\local\temp\pip_build_Mikuť\rpy2\setup.py", line 332, in <module>

    'rpy2': ['doc/source/rpy2_logo.png', ]}

  File "D:\Python\Anaconda\lib\distutils\core.py", line 151, in setup

    dist.run_commands()

  File "D:\Python\Anaconda\lib\distutils\dist.py", line 953, in run_commands

    self.run_command(cmd)

  File "D:\Python\Anaconda\lib\distutils\dist.py", line 972, in run_command

    cmd_obj.run()

  File "<string>", line 14, in replacement_run

  File "D:\Python\Anaconda\lib\site-packages\setuptools-7.0-py2.7.egg\setuptools\command\egg_info.py", line 193, in find_sources

  File "D:\Python\Anaconda\lib\site-packages\setuptools-7.0-py2.7.egg\setuptools\command\egg_info.py", line 277, in run

  File "D:\Python\Anaconda\lib\site-packages\setuptools-7.0-py2.7.egg\setuptools\command\egg_info.py", line 306, in add_defaults

  File "D:\Python\Anaconda\lib\site-packages\setuptools-7.0-py2.7.egg\setuptools\command\sdist.py", line 185, in add_defaults

  File "D:\Python\Anaconda\lib\distutils\cmd.py", line 312, in get_finalized_command

    cmd_obj.ensure_finalized()

  File "D:\Python\Anaconda\lib\distutils\cmd.py", line 109, in ensure_finalized

    self.finalize_options()

  File "c:\users\miku~1\appdata\local\temp\pip_build_Mikuť\rpy2\setup.py", line 65, in finalize_options

    raise SystemExit("Error: R >= 2.8 required (and R told '%s')." %'.'.join(rexec.version))

TypeError: sequence item 0: expected string, int found

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in c:\users\miku~1\appdata\local\temp\pip_build_Mikuť\rpy2
Traceback (most recent call last):
  File "D:\Python\Anaconda\Scripts\pip-script.py", line 5, in <module>
    sys.exit(main())
  File "D:\Python\Anaconda\lib\site-packages\pip\__init__.py", line 161, in main
    return command.main(args[1:], options)
  File "D:\Python\Anaconda\lib\site-packages\pip\basecommand.py", line 169, in main
    text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0x9c in position 53: ordinal not in range(128)

Comments (11)

  1. Mikolaj Magnuski reporter

    It may be my fault though:

    λ echo %RHOME%
    D:\Programy\R-3.1.2\bin\x64\
    

    and rough look at setup.py leads me to believe I should have set RHOME to 'D:\Programy\R-3.1.2\' (without bin and x64)...

  2. Mikolaj Magnuski reporter

    Ok, I guess I have figured it out. For some reason the output from subprocess.check_output() that asks R for --version lands in stderr so there is nothing in stdout. The output can be redirected to stdout with stderr=subprocess.STDOUT:

    R_output = subprocess.check_output((r'D:\Programy\R-3.1.2\bin\R', '--version'))
    R_output
    Out[38]: ''
    
    R_output = subprocess.check_output((r'D:\Programy\R-3.1.2\bin\R', '--version'), stderr=subprocess.STDOUT)
    R_output
    Out[40]: 'R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet"\r\nCopyright (C) 2014 The R Foundation for Statistical Computing\r\nPlatform: i386-w64-mingw32/i386 (32-bit)\r\n\r\nR is free software and comes with ABSOLUTELY NO WARRANTY.\r\nYou are welcome to redistribute it under the terms of the\r\nGNU General Public License versions 2 or 3.\r\nFor more information about these matters see\r\nhttp://www.gnu.org/licenses/.\r\n\r\n'
    
  3. Mikolaj Magnuski reporter

    Another problem is that output.split(os.linesep) does not split the output because subprocess.check_output() gives text with normal (\n) newlines, not windows-specific (\r\n), because it uses 'universal_newlines = True`:

    output.split(os.linesep)
    Out[55]: ['R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet"\nCopyright (C) 2014 The R Foundation for Statistical Computing\nPlatform: i386-w64-mingw32/i386 (32-bit)\n\nR is free software and comes with ABSOLUTELY NO WARRANTY.\nYou are welcome to redistribute it under the terms of the\nGNU General Public License versions 2 or 3.\nFor more information about these matters see\nhttp://www.gnu.org/licenses/.\n\n']
    
    output.split('\n')
    Out[58]: 
    ['R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet"',
     'Copyright (C) 2014 The R Foundation for Statistical Computing',
     'Platform: i386-w64-mingw32/i386 (32-bit)',
     '',
     'R is free software and comes with ABSOLUTELY NO WARRANTY.',
     'You are welcome to redistribute it under the terms of the',
     'GNU General Public License versions 2 or 3.',
     'For more information about these matters see',
     'http://www.gnu.org/licenses/.',
     '',
     '']
    

    The need of using \n instead of \r\n can be simply checked:

    '\r\n' in output
    Out[60]: False
    
    '\n' in output
    Out[61]: True
    
  4. Log in to comment