8 Replies Latest reply on Jul 13, 2017 12:49 PM by Intel Corporation

    Problem installing matplotlib on Edison

    GCay

      I am trying to install matplotlib on my Intel Edison board but I am taking errors. I installed Numpy and Spicy successfully but could not manage to install matplotlib.

      I am getting this error

      root@edisonwbl:~# pip install matplotlib
      Collecting matplotlib
      /usr/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
       
      SNIMissingWarning
      /usr/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
       
      InsecurePlatformWarning
       
      Downloading matplotlib-2.0.2.tar.gz (53.9MB)
        
      99% |############################### | 53.9MB 623kB/s eta 0:00:01Exception:
      Traceback (most recent call last):
       
      File "/usr/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
        status
      = self.run(options, args)
       
      File "/usr/lib/python2.7/site-packages/pip/commands/install.py", line 324, in run
        requirement_set
      .prepare_files(finder)
       
      File "/usr/lib/python2.7/site-packages/pip/req/req_set.py", line 380, in prepare_files
        ignore_dependencies
      =self.ignore_dependencies))
       
      File "/usr/lib/python2.7/site-packages/pip/req/req_set.py", line 620, in _prepare_file
        session
      =self.session, hashes=hashes)
       
      File "/usr/lib/python2.7/site-packages/pip/download.py", line 821, in unpack_url
        hashes
      =hashes
       
      File "/usr/lib/python2.7/site-packages/pip/download.py", line 659, in unpack_http_url
        hashes
      )
       
      File "/usr/lib/python2.7/site-packages/pip/download.py", line 882, in _download_http_url
        _download_url
      (resp, link, content_file, hashes)
       
      File "/usr/lib/python2.7/site-packages/pip/download.py", line 603, in _download_url
        hashes
      .check_against_chunks(downloaded_chunks)
       
      File "/usr/lib/python2.7/site-packages/pip/utils/hashes.py", line 46, in check_against_chunks
        
      for chunk in chunks:
       
      File "/usr/lib/python2.7/site-packages/pip/download.py", line 571, in written_chunks
        
      for chunk in chunks:
       
      File "/usr/lib/python2.7/site-packages/pip/utils/ui.py", line 139, in iter
        
      for x in it:
       
      File "/usr/lib/python2.7/site-packages/pip/download.py", line 560, in resp_read
        decode_content
      =False):
       
      File "/usr/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/response.py", line 357, in stream
        data
      = self.read(amt=amt, decode_content=decode_content)
       
      File "/usr/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/response.py", line 314, in read
        data
      = self._fp.read(amt)
       
      File "/usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/filewrapper.py", line 63, in read
        self
      ._close()
       
      File "/usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/filewrapper.py", line 50, in _close
        self
      .__callback(self.__buf.getvalue())
       
      File "/usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/controller.py", line 275, in cache_response
        self
      .serializer.dumps(request, response, body=body),
       
      File "/usr/lib/python2.7/site-packages/pip/_vendor/cachecontrol/serialize.py", line 87, in dumps
        
      ).encode("utf8"),
      MemoryError

      I have Yocto 1. 7. 3 on Edison and firmware version is 201606061707

      Can anyone help me?

      Thanks in advance!

        • 1. Re: Problem installing matplotlib on Edison
          Intel Corporation
          This message was posted on behalf of Intel Corporation

          Hello GCay,

          Thanks for reaching out!

          I updated the version of pip in my Edison (same Yocto version as you) and it now provides me a more straight forward reason why it can't install matplotlib. I used pip install pip --upgrade to update my pip version and the libraries I'm missing are:

          freetype2 (https://www.freetype.org/)
          libpng (http://www.libpng.org/pub/png/libpng.html)

          I'd recommend you to download their source, build and install them on your Edison and then try again with the newer version of pip.

          Let us know how it goes.
          Pedro M.

          • 2. Re: Problem installing matplotlib on Edison
            GCay

            I could not figure out how to install these libraries. I keep trying.

             

            However, I tried to upgrade pip, after that I got this error.

             

            root@edisonwbl:~# pip install matplotlib

            Collecting matplotlib

            /usr/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_  .py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject   Name Indication) extension to TLS is not available on this platform. This may c  ause the server to present an incorrect TLS certificate, which can cause validat  ion failures. You can upgrade to a newer version of Python to solve this. For mo  re information, see https://urllib3.readthedocs.io/en/latest/security.html#snimi  ssingwarning.

              SNIMissingWarning

            /usr/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_  .py:122: InsecurePlatformWarning: A true SSLContext object is not available. Thi  s prevents urllib3 from configuring SSL appropriately and may cause certain SSL   connections to fail. You can upgrade to a newer version of Python to solve this.   For more information, see https://urllib3.readthedocs.io/en/latest/security.htm  l#insecureplatformwarning.

              InsecurePlatformWarning

              Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connec  tion broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.python.org', po  rt=443): Read timed out. (read timeout=15)",)': /simple/matplotlib/

            /usr/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_  .py:122: InsecurePlatformWarning: A true SSLContext object is not available. Thi  s prevents urllib3 from configuring SSL appropriately and may cause certain SSL   connections to fail. You can upgrade to a newer version of Python to solve this.   For more information, see https://urllib3.readthedocs.io/en/latest/security.htm  l#insecureplatformwarning.

              InsecurePlatformWarning

              Could not find a version that satisfies the requirement matplotlib (from versi  ons: )

            No matching distribution found for matplotlib

            • 3. Re: Problem installing matplotlib on Edison
              GCay

              For example, when I try configure for freetype2, I got this

               

              root@edisonwbl:~/freetype-2.8# ls

              CMakeLists.txt  ChangeLog.23  Jamrules    builds     modules.cfg

              ChangeLog       ChangeLog.24  Makefile    configure  objs

              ChangeLog.20    ChangeLog.25  README      devel      src

              ChangeLog.21    ChangeLog.26  README.git  docs       version.sed

              ChangeLog.22    Jamfile       autogen.sh  include    vms_make.com

              root@edisonwbl:~/freetype-2.8# cd configure

              -sh: cd: configure: Not a directory

              root@edisonwbl:~/freetype-2.8# python configure

                File "configure", line 16

                  rm -f config.mk builds/unix/unix-def.mk builds/unix/unix-cc.mk

                             ^

              SyntaxError: invalid syntax

               

              For libpng, I got this:

               

              root@edisonwbl:~/libpng-1.6.30# python configure

                File "configure", line 18

                  DUALCASE=1; export DUALCASE # for MKS sh

                                            ^

              SyntaxError: invalid syntax

              root@edisonwbl:~/libpng-1.6.30# python install-sh

                File "install-sh", line 45

                  nl='

                     ^

              SyntaxError: EOL while scanning string literal

              • 4. Re: Problem installing matplotlib on Edison
                Intel Corporation
                This message was posted on behalf of Intel Corporation

                That is strange, I updated pip and this is the error that I get:

                root@PeterBB:~# pip install matplotlib
                Collecting matplotlib
                /usr/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
                  SNIMissingWarning
                /usr/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
                  InsecurePlatformWarning
                  Using cached matplotlib-2.0.2.tar.gz
                    Complete output from command python setup.py egg_info:
                    ============================================================================
                    Edit setup.cfg to change the build options

                    BUILDING MATPLOTLIB
                                matplotlib: yes [2.0.2]
                                    python: yes [2.7.3 (default, Jun  6 2016, 13:14:10)  [GCC
                                            4.9.1]]
                                  platform: yes [linux2]

                    REQUIRED DEPENDENCIES AND EXTENSIONS
                                     numpy: yes [not found. pip may install it below.]
                                       six: yes [six was not found.pip will attempt to install
                                            it after matplotlib.]
                                  dateutil: yes [dateutil was not found. It is required for date
                                            axis support. pip/easy_install may attempt to
                                            install it after matplotlib.]
                               functools32: yes [functools32 was not found. It is required
                                            forPython versions prior to 3.2]
                              subprocess32: yes [subprocess32 was not found. It used  for Python
                                            versions prior to 3.2 to improves functionality on
                                            Linux and OSX]
                                      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 freetype2 (ft2build.h)
                                            could not be found.  You may need to install the
                                            development package.]
                                       png: no  [pkg-config information for 'libpng' could not
                                            be found.]
                                     qhull: yes [pkg-config information for 'qhull' could not be
                                            found. Using local copy.]

                    OPTIONAL SUBPACKAGES
                               sample_data: yes [installing]
                                  toolkits: yes [installing]
                                     tests: no  [skipping due to configuration]
                            toolkits_tests: no  [skipping due to configuration]

                    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: no  [Microsoft Windows only]

                    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 /tmp/pip-build-F_qkJK/matplotlib/

                As you can see, it does provide you the reason why it is failing. It is missing freetype2 and libpng. How did you update pip? Was it successfull or did it throw any error? 

                Regarding how to install  freetype2 and libpng, I'd suggest you to contact their respective developers to see if they can provide you a more accurate approach for their specific packages. You can reach them in:

                https://www.freetype.org/contact.html
                https://sourceforge.net/projects/libpng/support?source=navbar

                Let us know how it goes.
                Pedro M.

                • 5. Re: Problem installing matplotlib on Edison
                  GCay

                  The difference between your error and mine is that you are taking this error after download while it is building the matplotlib but I am taking it while it is downloading the matplotlib. Can it be internet connection issue?

                   

                  I used pip install pip --upgrade to upgrade and it said requirement already up-to-date.

                  • 6. Re: Problem installing matplotlib on Edison
                    GCay

                    Now, I got the same error with you. I think the first one was about a connection problem.

                     

                    I still need to figure out how to install freetype2 and libpng though.

                    • 7. Re: Problem installing matplotlib on Edison
                      GCay

                      I found how to install these packages and after install them I successfully installed matplotlib too. Thanks for your help.

                      • 8. Re: Problem installing matplotlib on Edison
                        Intel Corporation
                        This message was posted on behalf of Intel Corporation

                        Hi Gcay,

                        I'm glad to hear that!

                        If you ever have any other question or doubt, please don't hesitate to come back to the community. We'll try to help you as much as we can.

                        Pedro M.