Can't Build Matplotlib (Png Package Issue)

Python matplotlib install issue on Windows 7 for freetype, png packages

http://www.lfd.uci.edu/~gohlke/pythonlibs/

Get matplotlib from above location. Choose correct package based on python(2.x/3.x) and bit(32/64) version.

32-bit 2.7: matplotlib-1.5.2-cp27-cp27m-win32.whl
64-bit 2.7: matplotlib-1.5.2-cp27-cp27m-win_amd64.whl

If you face any issues in the middle, please refer to below link:
https://stackoverflow.com/a/38618044/5334188

Python (Win 10): Installing matplotlib requires packages freetype and png?

Use a more powerful installer

I would recommend to use Anaconda or Miniconda. In my experience with many Windows users, this is the simplest way to install packages such as matplotlib.

Anaconda

Anaconda comes with many packages for scientists. Matplotlib works out of the box. Just install as user not root.

Minoconda

If you don't want all packages of Ananconda use Miniconda

Conda

Both ways of installation (Anaconda or Miniconda) provide conda. It is an improved pip/virtualenv.

You can install matplotilb with this command:

conda install matplotlib

Enviroments:

You can create a new environment and install the packages you like:

conda create -n my_project35 python=3.5
activate my_project35
conda install matplotlib

or

conda create -n my_project27 python=2.7
activate my_project27
conda install matplotlib

Combine with pip

You can still use pip. conda "understands" what it is doing.

i have a problem with installing matplotlib

The latest stable version is 3.4.3. On PyPI there is no matplotlib wheel for 3.10, yet. So it try to compile from source. And for that it needs Microsoft Visual C++ 14.0 or greater.

However you can download unofficial binary from Gohlke
Alternatively you can use pipwin to install it from Gohlke. Note there may still be problems with dependencies.

Of course, you can also downgrade to python3.9.



Related Topics



Leave a reply



Submit