Installation fails on windows because sysconfig.get_config_var("CC") is None

Issue #280 closed
Mikolaj Magnuski
created an issue

The problem:

I tried installing rpy2 today and got the error posted below.

short story:

distutils fails
sysconfig is looking for CC configuration variable but it is not defined.
so None is passed to os.path.basename and the error comes to existence

The whole error starts in distutils\unixccompiler.py but I am on windows...

The error I am getting:

    writing build\temp.win32-2.7\Release\.\rpy\rinterface\_rinterface.def
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "c:\users\miku~1\appdata\local\temp\pip-build-kjpgiq\rpy2\setup.py", l
ine 337, 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 "D:\Python\Anaconda\lib\site-packages\setuptools-16.0-py2.7.egg\setupt
ools\command\install.py", line 61, in run
      File "D:\Python\Anaconda\lib\distutils\command\install.py", line 563, in ru
n
        self.run_command('build')
      File "D:\Python\Anaconda\lib\distutils\cmd.py", line 326, in run_command
        self.distribution.run_command(command)
      File "D:\Python\Anaconda\lib\distutils\dist.py", line 972, in run_command
        cmd_obj.run()
      File "D:\Python\Anaconda\lib\distutils\command\build.py", line 127, in run
        self.run_command(cmd_name)
      File "D:\Python\Anaconda\lib\distutils\cmd.py", line 326, in run_command
        self.distribution.run_command(command)
      File "D:\Python\Anaconda\lib\distutils\dist.py", line 972, in run_command
        cmd_obj.run()
      File "c:\users\miku~1\appdata\local\temp\pip-build-kjpgiq\rpy2\setup.py", l
ine 78, in run
        _build_ext.run(self)
      File "D:\Python\Anaconda\lib\site-packages\setuptools-16.0-py2.7.egg\setupt
ools\command\build_ext.py", line 50, in run
      File "D:\Python\Anaconda\lib\distutils\command\build_ext.py", line 337, in
run
        self.build_extensions()
      File "D:\Python\Anaconda\lib\distutils\command\build_ext.py", line 446, in
build_extensions
        self.build_extension(ext)
      File "D:\Python\Anaconda\lib\site-packages\setuptools-16.0-py2.7.egg\setupt
ools\command\build_ext.py", line 183, in build_extension
      File "D:\Python\Anaconda\lib\distutils\command\build_ext.py", line 528, in
build_extension
        target_lang=language)
      File "D:\Python\Anaconda\lib\distutils\ccompiler.py", line 691, in link_sha
red_object
        extra_preargs, extra_postargs, build_temp, target_lang)
      File "D:\Python\Anaconda\lib\distutils\cygwinccompiler.py", line 260, in li
nk
        target_lang)
      File "D:\Python\Anaconda\lib\distutils\unixccompiler.py", line 160, in link

        libraries)
      File "D:\Python\Anaconda\lib\distutils\ccompiler.py", line 1071, in gen_lib
_options
        opt = compiler.runtime_library_dir_option(dir)
      File "D:\Python\Anaconda\lib\distutils\unixccompiler.py", line 227, in runt
ime_library_dir_option
        compiler = os.path.basename(sysconfig.get_config_var("CC"))
      File "D:\Python\Anaconda\lib\ntpath.py", line 170, in basename
        return split(p)[1]
      File "D:\Python\Anaconda\lib\ntpath.py", line 142, in split
        d, p = splitdrive(p)
      File "D:\Python\Anaconda\lib\ntpath.py", line 94, in splitdrive
        if p[1:2] == ':':
    TypeError: 'NoneType' object has no attribute '__getitem__'

    ----------------------------------------
Command "D:\Python\Anaconda\python.exe -c "import setuptools, tokenize;__file__='
c:\\users\\miku~1\\appdata\\local\\temp\\pip-build-kjpgiq\\rpy2\\setup.py';exec(c
ompile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __
file__, 'exec'))" install --record c:\users\miku~1\appdata\local\temp\pip-zfgldt-
record\install-record.txt --single-version-externally-managed --compile" failed w
ith error code 1 in c:\users\miku~1\appdata\local\temp\pip-build-kjpgiq\rpy2

Comments (1)

  1. Log in to comment