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>
1
  • 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. Commented Jun 2, 2014 at 20:09

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

3 Comments

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?
Download EXE and run (double click) it -> installs matplotlib without installing dependencies
[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 to install with easy_install.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.