1

I'm trying to install matplotlib on windows using easy-install and also I tried pip, but I'm getting the error below, how can I fix this

error: Setup script exited with error: Could not initialize compiler instance: do you have Visual Studio installed? If you are trying to build with mingw, please use python setup.py build -c mingw32 instead. If you have Visual Studio installed, check it is correctly installed, and the right version (VS 2008 for python 2.6, VS 2003 for 2.5, etc...). Original exception was: Unable to find vcvarsall.bat, and the Compiler class was MSVCCompiler

Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "C:\Python26\lib\atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "C:\Python26\lib\multiprocessing\util.py", line 270, in _exit_function
    info('process shutting down')
TypeError: 'NoneType' object is not callable
Error in sys.exitfunc:
Traceback (most recent call last):
  File "C:\Python26\lib\atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "C:\Python26\lib\multiprocessing\util.py", line 270, in _exit_function
    info('process shutting down')
TypeError: 'NoneType' object is not callable

C:\Python26\Scripts>
sophros
  • 14,672
  • 11
  • 46
  • 75
msiles
  • 657
  • 3
  • 10
  • 19
  • 2
    If you don't have a compiler installed and don't want to compile it yourself, you should just download one of the installer EXEs from the matplotlib site. – BrenBarn Jun 02 '14 at 20:09

1 Answers1

1

Compiling C extensions on Windows requires VisualStudio Express in the most cases and will be far from easy. Instead you can download the binary package for your Python version to a local directory and install with easy_install like so:

easy_install "C:\path_to_local_binary_dir\matplotlib-1.3.1-win-xxx.exe"

(replace with full path/filename). This will not show up in Add/Remove programs and also works for virtual envs.

nepix32
  • 3,012
  • 2
  • 14
  • 29
  • I have visual studio already installed, but I'm not sure if I had to do something with it... if I download the exe, is that the same that easy_install matplotlib or pip install matplotlib? – msiles Jun 04 '14 at 01:16
  • Download EXE and run (double click) it -> installs `matplotlib` **without** installing dependencies – nepix32 Jun 04 '14 at 08:58
  • [cont'd] Only for Installer run: Creates entry in Add/Remove programs. * Download EXE and install it from local path with `easy_install` -> as above, but does also install dependency packages (pytz, pyparsind, dateutils, ...). You will note that package `numpy` will also not be easy to install with `pip`, [use this](http://stackoverflow.com/a/6753898/2683116) to install with `easy_install`. – nepix32 Jun 04 '14 at 09:09