Modulenotfounderror:no module or modulenotfounderror:no module named ' Matplotlib._path ' Reasons and solutions

Source: Internet
Author: User
Tags install matplotlib

Environment: Ubuntun14.04lts +anaconda4.2+tensorflow1.2+pycharm community2017.3.3

When running the. py file, 1. The Importerror:no module named appears Matplotlib.pyplot

2.
Appears Modulenotfounderror:no module Namedmatplotlib._path "

Explanation of Reason:

In the first case, there is importerror:no module named Matplotlib.pyplot

Reason: Matplotlib package not installed

Corresponding solution: Terminal terminal input sudo apt-get intall python-matplotlib

or pip install Matplotlib


In the second case, the Modulenotfounderror:no module Namedmatplotlib._path appears

Cause analysis: Anaconda, it directly all can use or not to import the package, may already contain matplotlib package, and pycharm inside already installed matplotlib bag;

So the Python compiler does not recognize two versions of the Matplotlib package, you need to remove one and put another package under the Anaconda directory to solve the problem

Use the PIP install Matplotlib to view the location of the Matplotlib package (if the Matplotlib package is already installed): Displays the installed success and location you have installed

(for example, I belong to the first case, direct installation can be completed through the PIP Install matplotlib view its installation path)


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.