Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot install 3.0.0 "python setup.py egg_info" failed (freetype & png) #12169

Closed
dumbledad opened this issue Sep 19, 2018 · 16 comments
Closed

Comments

@dumbledad
Copy link

dumbledad commented Sep 19, 2018

I cannot install matplotlib.

I am on a Dell Precision 5820 running Windows 10.0.17763

I have tried downloading the source and building locally, using their installers to install freetype and png, restarting the machine, running the command prompt as administrator, running python -mpip install -U matplotlib instead, updating pip, updating setuptools, installing ez_setup, ...

This is the readout I get from pip install matplotlib

Collecting matplotlib
Using cached https://files.pythonhosted.org/packages/ec/06/def4fb2620cbe671ba0cb6462cbd8653fbffa4acd87d6d572659e7c71c13/matplotlib-3.0.0.tar.gz
Complete output from command python setup.py egg_info:
============================================================================
Edit setup.cfg to change the build options

BUILDING MATPLOTLIB
            matplotlib: yes [3.0.0]
                python: yes [3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018,
                        04:06:47) [MSC v.1914 32 bit (Intel)]]
              platform: yes [win32]

REQUIRED DEPENDENCIES AND EXTENSIONS
                 numpy: yes [version 1.15.1]
      install_requires: yes [handled by setuptools]
                libagg: yes [pkg-config information for 'libagg' could not
                        be found. Using local copy.]
              freetype: no  [The C/C++ header for freetype
                        (freetype2\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 'libqhull' 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
                   agg: yes [installing]
                 tkagg: yes [installing; run-time loading from Python Tcl /
                        Tk]
                macosx: no  [Mac OS-X only]
             windowing: yes [installing]

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

============================================================================
                        * The following required packages can not be built:
                        * freetype, png
                        * Please check http://gnuwin32.sourceforge.net/packa
                        * ges/freetype.htm for instructions to install
                        * freetype
                        * Please check http://gnuwin32.sourceforge.net/packa
                        * ges/libpng.htm for instructions to install png

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in C:\Users\timregan\AppData\Local\Temp\pip-install-ub5eg6x_\matplotlib\

@dumbledad
Copy link
Author

Note that pip install matplotlib==2.2.3 works without error

@ImportanceOfBeingErnest
Copy link
Member

First of all it's clear that matplotlib will not install correctly when freetype and libpng are missing. So the problem would be to get those installed.

I can reproduce the fact that pip seems to be unable to install those

(mpl300testing03) C:\Users>python -mpip install freetype
Collecting freetype
  Could not find a version that satisfies the requirement freetype (from versions: )
No matching distribution found for freetype

same story for libpng. This is within an environment created via conda create -n mpl300testing03 python=3.7 numpy.

However, conda seems to be able to sucessfully install them.

> conda create -n mpl300testing04 python=3.7 numpy freetype libpng
> activate mpl300testing04
(mpl300testing04) > python -mpip install matplotlib==3

works fine for me.

@tacaswell
Copy link
Member

@dumbledad Try again now, I failed to correctly upload all of the wheels so you are getting the tarball and trying to compile from source!

@ImportanceOfBeingErnest
Copy link
Member

Oh, that would then also be the solution for #12168 I guess?

@tacaswell
Copy link
Member

Most likely.

@tacaswell
Copy link
Member

Closing as #12168 is almost certainly the same problem and is reported fixed.

@dumbledad
Copy link
Author

@tacaswell That's fixed it, thanks.

@sonineha2191
Copy link

conda install freetype
conda install libpng
conda install matplotlib

worked for me!!

@keshavm02
Copy link

Still hasn't worked for me- tried everything above.

@jaysonpowers-zz
Copy link

same

@Amol-Bhowad
Copy link

@tacaswell I also got same error while installing matplotlib
Running setup.py clean for matplotlib
Failed to build matplotlib
Installing collected packages: matplotlib
Running setup.py install for matplotlib ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Python\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\AMOL B\AppData\Local\Temp\pip-install-hda_360c\matplotlib\setup.py'"'"'; file='"'"'C:\Users\AMOL B\AppData\Local\Temp\pip-install-hda_360c\matplotlib\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\AMOL B\AppData\Local\Temp\pip-record-p_ol2cb6\install-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\AMOL B\AppData\Local\Temp\pip-install-hda_360c\matplotlib
Complete output (499 lines):
================================================================================
Edit setup.cfg to change the build options

BUILDING MATPLOTLIB
  matplotlib: yes [3.1.1]
      python: yes [3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:37:50) [MSC
                  v.1916 64 bit (AMD64)]]
    platform: yes [win32]

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

OPTIONAL BACKEND EXTENSIONS
         agg: yes [installing]
       tkagg: yes [installing; run-time loading from Python Tcl/Tk]
      macosx: no  [Mac OS-X only]

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

running install

@timhoffm
Copy link
Member

@Amol-Bhowad @mathacka There are no binary wheels for python 3.8 yet. See #15708 (comment).

@Amol-Bhowad
Copy link

Thanks @timhoffm Sir It Worked!

@EzequielBurg
Copy link

I have the same problem when I execute my python app in a docker-compose. In the requirements, I have matplotlib==3.0.3 and when I run the file, it's returned:

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

Note: In my requirements I have before matplotlib: freetype-py==2.1.0 and pypng==0.0.20

Please someone help me

@LeMutique
Copy link

Same as above.. Using python 3.8.2

@AchinthyaBhat
Copy link

AchinthyaBhat commented Apr 30, 2020

This worked for me. Change the matplotlib version as needed.

sudo apt-get install libfreetype6-dev
pip3 install matplotlib==2.2.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests