5
votes

I have recently got a new laptop and I want to install all of my python libraries. However, some of them just won't install, like matplotlib.

About my computer: Windows 10 with Python 3.6, and according to pip, these libraries.

colorama (0.3.7)
Django (1.8.17)
Mathics (1.0)
mpmath (0.19)
pip (9.0.1)
python-dateutil (2.6.0)
setuptools (32.3.0)
six (1.10.0)
sympy (1.0)
wheel (0.29.0)

Result of "pip install matplotlib":

Error processing line 1 of c:\users\marvi\appdata\local\programs\python\python36\lib\site-packages\matplotlib-2.0.0rc2-py3.6-nspkg.pth:

  Traceback (most recent call last):
    File "c:\users\marvi\appdata\local\programs\python\python36\lib\site.py", line 169, in addpackage
      exec(line)
    File "", line 1, in 
    File "", line 557, in module_from_spec
  AttributeError: 'NoneType' object has no attribute 'loader'

Remainder of file ignored
Collecting matplotlib
  Using cached matplotlib-1.5.3.tar.gz
    Complete output from command python setup.py egg_info:
    Error processing line 1 of c:\users\marvi\appdata\local\programs\python\python36\lib\site-packages\matplotlib-2.0.0rc2-py3.6-nspkg.pth:

      Traceback (most recent call last):
        File "c:\users\marvi\appdata\local\programs\python\python36\lib\site.py", line 169, in addpackage
          exec(line)
        File "", line 1, in 
        File "", line 557, in module_from_spec
      AttributeError: 'NoneType' object has no attribute 'loader'

    Remainder of file ignored
    Error processing line 1 of c:\users\marvi\appdata\local\programs\python\python36\lib\site-packages\matplotlib-2.0.0rc2-py3.6-nspkg.pth:

      Traceback (most recent call last):
        File "c:\users\marvi\appdata\local\programs\python\python36\lib\site.py", line 169, in addpackage
          exec(line)
        File "", line 1, in 
        File "", line 557, in module_from_spec
      AttributeError: 'NoneType' object has no attribute 'loader'

    Remainder of file ignored
    Error processing line 1 of c:\users\marvi\appdata\local\programs\python\python36\lib\site-packages\matplotlib-2.0.0rc2-py3.6-nspkg.pth:

      Traceback (most recent call last):
        File "c:\users\marvi\appdata\local\programs\python\python36\lib\site.py", line 169, in addpackage
          exec(line)
        File "", line 1, in 
        File "", line 557, in module_from_spec
      AttributeError: 'NoneType' object has no attribute 'loader'

    Remainder of file ignored
    Error processing line 1 of c:\users\marvi\appdata\local\programs\python\python36\lib\site-packages\matplotlib-2.0.0rc2-py3.6-nspkg.pth:

      Traceback (most recent call last):
        File "c:\users\marvi\appdata\local\programs\python\python36\lib\site.py", line 169, in addpackage
          exec(line)
        File "", line 1, in 
        File "", line 557, in module_from_spec
      AttributeError: 'NoneType' object has no attribute 'loader'

    Remainder of file ignored
    Error processing line 1 of c:\users\marvi\appdata\local\programs\python\python36\lib\site-packages\matplotlib-2.0.0rc2-py3.6-nspkg.pth:

      Traceback (most recent call last):
        File "c:\users\marvi\appdata\local\programs\python\python36\lib\site.py", line 169, in addpackage
          exec(line)
        File "", line 1, in 
        File "", line 557, in module_from_spec
      AttributeError: 'NoneType' object has no attribute 'loader'

    Remainder of file ignored
    Error processing line 1 of c:\users\marvi\appdata\local\programs\python\python36\lib\site-packages\matplotlib-2.0.0rc2-py3.6-nspkg.pth:

      Traceback (most recent call last):
        File "c:\users\marvi\appdata\local\programs\python\python36\lib\site.py", line 169, in addpackage
          exec(line)
        File "", line 1, in 
        File "", line 557, in module_from_spec
      AttributeError: 'NoneType' object has no attribute 'loader'

    Remainder of file ignored
    Error processing line 1 of c:\users\marvi\appdata\local\programs\python\python36\lib\site-packages\matplotlib-2.0.0rc2-py3.6-nspkg.pth:

      Traceback (most recent call last):
        File "c:\users\marvi\appdata\local\programs\python\python36\lib\site.py", line 169, in addpackage
          exec(line)
        File "", line 1, in 
        File "", line 557, in module_from_spec
      AttributeError: 'NoneType' object has no attribute 'loader'

    Remainder of file ignored
    Error processing line 1 of c:\users\marvi\appdata\local\programs\python\python36\lib\site-packages\matplotlib-2.0.0rc2-py3.6-nspkg.pth:

      Traceback (most recent call last):
        File "c:\users\marvi\appdata\local\programs\python\python36\lib\site.py", line 169, in addpackage
          exec(line)
        File "", line 1, in 
        File "", line 557, in module_from_spec
      AttributeError: 'NoneType' object has no attribute 'loader'

    Remainder of file ignored
    Error processing line 1 of c:\users\marvi\appdata\local\programs\python\python36\lib\site-packages\matplotlib-2.0.0rc2-py3.6-nspkg.pth:

      Traceback (most recent call last):
        File "c:\users\marvi\appdata\local\programs\python\python36\lib\site.py", line 169, in addpackage
          exec(line)
        File "", line 1, in 
        File "", line 557, in module_from_spec
      AttributeError: 'NoneType' object has no attribute 'loader'

    Remainder of file ignored
 Error processing line 1 of c:\users\marvi\appdata\local\programs\python\python36\lib\site-packages\matplotlib-2.0.0rc2-py3.6-nspkg.pth:

      Traceback (most recent call last):
        File "c:\users\marvi\appdata\local\programs\python\python36\lib\site.py", line 169, in addpackage
          exec(line)
        File "", line 1, in 
        File "", line 557, in module_from_spec
      AttributeError: 'NoneType' object has no attribute 'loader'

    Remainder of file ignored
    Error processing line 1 of c:\users\marvi\appdata\local\programs\python\python36\lib\site-packages\matplotlib-2.0.0rc2-py3.6-nspkg.pth:

      Traceback (most recent call last):
        File "c:\users\marvi\appdata\local\programs\python\python36\lib\site.py", line 169, in addpackage
          exec(line)
        File "", line 1, in 
        File "", line 557, in module_from_spec
      AttributeError: 'NoneType' object has no attribute 'loader'

    Remainder of file ignored
    Error processing line 1 of c:\users\marvi\appdata\local\programs\python\python36\lib\site-packages\matplotlib-2.0.0rc2-py3.6-nspkg.pth:

      Traceback (most recent call last):
        File "c:\users\marvi\appdata\local\programs\python\python36\lib\site.py", line 169, in addpackage
          exec(line)
        File "", line 1, in 
        File "", line 557, in module_from_spec
      AttributeError: 'NoneType' object has no attribute 'loader'

    Remainder of file ignored
    Error processing line 1 of c:\users\marvi\appdata\local\programs\python\python36\lib\site-packages\matplotlib-2.0.0rc2-py3.6-nspkg.pth:

      Traceback (most recent call last):
        File "c:\users\marvi\appdata\local\programs\python\python36\lib\site.py", line 169, in addpackage
          exec(line)
        File "", line 1, in 
        File "", line 557, in module_from_spec
      AttributeError: 'NoneType' object has no attribute 'loader'

    Remainder of file ignored
    Error processing line 1 of c:\users\marvi\appdata\local\programs\python\python36\lib\site-packages\matplotlib-2.0.0rc2-py3.6-nspkg.pth:

      Traceback (most recent call last):
        File "c:\users\marvi\appdata\local\programs\python\python36\lib\site.py", line 169, in addpackage
          exec(line)
        File "", line 1, in 
        File "", line 557, in module_from_spec
      AttributeError: 'NoneType' object has no attribute 'loader'

    Remainder of file ignored
    Error processing line 1 of c:\users\marvi\appdata\local\programs\python\python36\lib\site-packages\matplotlib-2.0.0rc2-py3.6-nspkg.pth:

      Traceback (most recent call last):
        File "c:\users\marvi\appdata\local\programs\python\python36\lib\site.py", line 169, in addpackage
          exec(line)
        File "", line 1, in 
        File "", line 557, in module_from_spec
      AttributeError: 'NoneType' object has no attribute 'loader'

    Remainder of file ignored
    Error processing line 1 of c:\users\marvi\appdata\local\programs\python\python36\lib\site-packages\matplotlib-2.0.0rc2-py3.6-nspkg.pth:

      Traceback (most recent call last):
        File "c:\users\marvi\appdata\local\programs\python\python36\lib\site.py", line 169, in addpackage
          exec(line)
        File "", line 1, in 
        File "", line 557, in module_from_spec
      AttributeError: 'NoneType' object has no attribute 'loader'

    Remainder of file ignored
    Error processing line 1 of c:\users\marvi\appdata\local\programs\python\python36\lib\site-packages\matplotlib-2.0.0rc2-py3.6-nspkg.pth:

      Traceback (most recent call last):
        File "c:\users\marvi\appdata\local\programs\python\python36\lib\site.py", line 169, in addpackage
          exec(line)
        File "", line 1, in 
        File "", line 557, in module_from_spec
      AttributeError: 'NoneType' object has no attribute 'loader'

    Remainder of file ignored
    ============================================================================
    Edit setup.cfg to change the build options

    BUILDING MATPLOTLIB
                matplotlib: yes [1.5.3]
                    python: yes [3.6.0 (v3.6.0:41df79263a11, Dec 23 2016,
                            08:06:12) [MSC v.1900 64 bit (AMD64)]]
                  platform: yes [win32]

    REQUIRED DEPENDENCIES AND EXTENSIONS
                     numpy: yes [not found. pip may install it below.]
                  dateutil: yes [using dateutil version 2.6.0]
                      pytz: yes [pytz was not found. pip will attempt to install
                            it after matplotlib.]
                    cycler: yes [cycler was not found. pip will attempt to
                            install it after matplotlib.]
                   tornado: yes [tornado was not found. It is required for the
                            WebAgg backend. pip/easy_install may attempt to
                            install it after matplotlib.]
                 pyparsing: yes [pyparsing was not found. It is required for
                            mathtext support. pip/easy_install may attempt to
                            install it after matplotlib.]
                    libagg: yes [pkg-config information for 'libagg' could not
                            be found. Using local copy.]
                  freetype: no  [The C/C++ header for freetype (ft2build.h)
                            could not be found.  You may need to install the
                            development package.]
                       png: no  [The C/C++ header for png (png.h) could not be
                            found.  You may need to install the development
                            package.]
                     qhull: yes [pkg-config information for 'qhull' could not be
                            found. Using local copy.]

    OPTIONAL SUBPACKAGES
               sample_data: yes [installing]
                  toolkits: yes [installing]
                     tests: yes [nose 0.11.1 or later is required to run the
                            matplotlib test suite. Please install it with pip or
                            your preferred tool to run the test suite / using
                            unittest.mock]
            toolkits_tests: yes [nose 0.11.1 or later is required to run the
                            matplotlib test suite. Please install it with pip or
                            your preferred tool to run the test suite / using
                            unittest.mock]

    OPTIONAL BACKEND EXTENSIONS
                    macosx: no  [Mac OS-X only]
                    qt5agg: no  [PyQt5 not found]
                    qt4agg: no  [PySide not found; PyQt4 not found]
                   gtk3agg: no  [Requires pygobject to be installed.]
                 gtk3cairo: no  [Requires cairocffi or pycairo to be installed.]
                    gtkagg: no  [Requires pygtk]
                     tkagg: yes [installing; run-time loading from Python Tcl /
                            Tk]
                     wxagg: no  [requires wxPython]
                       gtk: no  [Requires pygtk]
                       agg: yes [installing]
                     cairo: no  [cairocffi or pycairo not found]
                 windowing: yes [installing]

    OPTIONAL LATEX DEPENDENCIES
                    dvipng: no
               ghostscript: no
                     latex: no
                   pdftops: no

    OPTIONAL PACKAGE DATA
                      dlls: no  [skipping due to configuration]

    ============================================================================
                            * The following required packages can not be built:
                            * freetype, png

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\marvi\AppData\Local\Temp\pip-build-a0hjoody\matplotlib\

Basically, something about cached files, a bunch of AttributeErrors from site.py and something about not having freetype or png. I tried to fix site.py, but it still doesn't work. I tried the .whl file from PyPi, and that doesn't work. I tried "pip install matplotlib --no-cache-dir", same thing. I tried manually downloading png and freetype, but I couldn't find them. Roughly the same thing happens with all the other libraries that I want to download: NumPy, SciPy, pandas.

3
Do you have other version of Python installed?andrepogg
no. Unless Windows 10 comes with ituser5442649
So, I've try to start a fresh Win 10 OS, installed python 3.6 and you are true. It comes without some packages... You can find Freetype here and the PNG one here. I hope this will help youandrepogg
Try with this for freetype and this one for PNG. When you install the "exe" I think you are okandrepogg
UPDATE: On OS X, install freetype and PNG from the links that @andrepogg supplied worked fine. Many thanks.cdarke

3 Answers

2
votes

If you use anaconda with Python 3.6 you can use:

conda install -c conda-forge python=3.6.0
conda install matplotlib --channel conda-forge

To download anaconda visit https://www.continuum.io/downloads

2
votes

1.5.1 version does not have this problem,can you check this:

pip install matplotlib==1.5.1 
0
votes

Like you I went around in circles over this one!

If you install from PyPI it should be OK. I used matplotlib-2.0.0rc2-cp36-cp36m-win32.whl, but there is a 64-bit version as well.

I installed using cmd.exe "Run as Administrator" with the python directories in my path:

pip3 install matplotlib-2.0.0rc2-cp36-cp36m-win32.whl