简体   繁体   中英

how to install matplotlib in python 3 with os windows

from this site

http://matplotlib.sourceforge.net/users/installing.html#installing-from-source

tell us that the requirement is python 2.4 or later but not python3.

Now im working with python3 and i need some plot form matplotlib.

So how to solve it?

I'm sorry, but at the current time it's not supported.
If you feel brave, you can try with the Py3k SVN branch which reportedly works with a simple example. Be aware that there has been no update in the last 8 months on this though. Of course, you'd be more than welcome to contribute to the porting to Python 3 if you could.

You could try the unofficial versions. Check this site:

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

Looking at the docs at the link it says the following is a dependency:

Python (>= 2.7 or >= 3.4)

You can download a version of Python that will work at:

https://www.python.org/downloads/windows/

I would go with the most recent release and a 64 bit version as certain libraries for data analysis do not run on the 32 bit version of Python.

The version of Python you download will come with pip which you can then use to install any libraries you need to do your work.

Make sure you have set your environment variables if you want to run your programs from the command line or bash terminal.

I installed matplotlib through the bash terminal with:

pip install matplotlib

Let me know if that helps.

To install matplotlib on windows, first, you have to install pip first to install pip on windows go to website

https://pip.pypa.io/en/stable/installing/#do-i-need-to-install-pip

Download get-pip.py, being careful to save it as a .py file rather than .txt. Then, run it from the command prompt:

python get-pip.py

if pip is already installed, install matplotlib by writing in command prompt:

python -mpip install -U pip
python -mpip install -U matplotlib

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM