Matplotlib using the Times error Runtimeerror:python is not installed as a framework

Source: Internet
Author: User

I have an error when I run the matplotlib after the first installation.

1 Import Matplotlib as MLB 2  from Import Pylab as PL 3 4 5 x = [1,3,5,7,6,9,10,13,16]6 y = [3,4,5,7,9,0,1,2,3]78  pl.plot (x, y)9 pl.show ()

Error content

Runtimeerror:python is not installed as a framework. The Mac OS X backend'll isn't able to function correctly if Python was not installed as a framework. See the Python documentation for more information on installing Python as a framework on MAC OS X. Either reinstall Python as a framework, or try one of the other backends. If you is using (Ana) Conda Please install Python.app and replace the use of ' Python ' with ' pythonw '. See ' Working with Matplotlib on OSX ' in the Matplotlib FAQs for more information.

Workaround:

1. Open terminal, enter CD ~/.matplotlib

2. New file, vi MATPLOTLIBRC

3, add the contents of the file, press the I key, then enter the content Backend:tkagg, then click ESC, enter: Number, enter Wq, and then enter OK

4. Rerun the script

The results are as follows:

Matplotlib using the Times error Runtimeerror:python is not installed as a framework

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.