Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Numpy installation error. (Mingw32CCompiler instance has no attribute 'compile_options')

Tags:

I use python with windows8 / anaconda spyder (2.7) I'm trying to update Theano up-to-date. When I installing the theano by

"pip install --upgrade theano"

The error happens at numpy installation part.

Though numpy is available to use in anaconda GUI, But is not shown in anaconda terminal. (pip show numpy outputs nothing)

The error is like below (when I try to install numpy, same error happens)

  File "c:\users\user\appdata\local\temp\pip_build_user\numpy\numpy\distutils\command\build_src.py", line 329, in build_extension_sources

    sources = self.generate_sources(sources, ext)

  File "c:\users\user\appdata\local\temp\pip_build_user\numpy\numpy\distutils\command\build_src.py", line 386, in generate_sources

    source = func(extension, build_dir)

  File "numpy\core\setup.py", line 455, in generate_config_h

    rep = check_long_double_representation(config_cmd)

  File "numpy\core\setup_common.py", line 191, in check_long_double_representation

    cmd.compiler.compile_options.remove("/GL")

AttributeError: Mingw32CCompiler instance has no attribute 'compile_options'

----------------------------------------
Cleaning up...
  Removing temporary dir c:\users\user\appdata\local\temp\pip_build_user...
Command C:\Anaconda\python.exe -c "import setuptools, tokenize;__file__='c:\\users\\user\\appdata\\local\\temp\\pip_build_user\\numpy\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\user\appdata\local\temp\pip-nm4fpu-record\install-record.txt --single-version-externally-managed --compile failed with error code 1 in c:\users\user\appdata\local\temp\pip_build_user\numpy
Exception information:
Traceback (most recent call last):
  File "C:\Anaconda\lib\site-packages\pip\basecommand.py", line 122, in main
    status = self.run(options, args)
  File "C:\Anaconda\lib\site-packages\pip\commands\install.py", line 283, in run
    requirement_set.install(install_options, global_options, root=options.root_path)
  File "C:\Anaconda\lib\site-packages\pip\req.py", line 1435, in install
    requirement.install(install_options, global_options, *args, **kwargs)
  File "C:\Anaconda\lib\site-packages\pip\req.py", line 706, in install
    cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
  File "C:\Anaconda\lib\site-packages\pip\util.py", line 697, in call_subprocess
    % (command_desc, proc.returncode, cwd))
InstallationError: Command C:\Anaconda\python.exe -c "import setuptools, tokenize;__file__='c:\\users\\user\\appdata\\local\\temp\\pip_build_user\\numpy\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\user\appdata\local\temp\pip-nm4fpu-record\install-record.txt --single-version-externally-managed --compile failed with error code 1 in c:\users\user\appdata\local\temp\pip_build_user\numpy
like image 281
MJ.Shin Avatar asked Nov 24 '15 06:11

MJ.Shin


1 Answers

This is most likely a numpy issue. Unfortunately I could not upgrade theano even after the fix I will suggest, but following a step by step guide like this one might work.

This specific problem occurs because numpy.distutils.misc_util.mingw32() returns False while it shouldn't. See also this discussion and the source . I decided to set manually the system variable MSYSTEM to MINGW32 which was not defined in my system and which I find unlikely to break any other behavior.

As I said this does not guarantee that the upgrade will work nor that there will be no side effects, but it will solve the issue mentioned here.

like image 132
kon psych Avatar answered Sep 25 '22 07:09

kon psych