I am new to pandas_profiling and getting ImportError while importing it. Please help.
import numpy as np
import pandas as pd
import pandas_profiling
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
%matplotlib inline
import seaborn as sns
After executing the above code in jupyter notebook, I am getting the following error.
ImportError: matplotlib is required for plotting when the default backend "matplotlib" is selected.
> python --version
Python 3.7.3
> pip list | grep -E "matplotlib|pandas"
matplotlib 3.2.0
pandas 0.25.3
pandas-profiling 2.5.3
In Matplotlib, Bar Graphs are made using plt. plot() with plt. bar() and voila! We get a bar plot.
This is because Microsoft C++Build Tools hasn't been installed in your computer. In order to run matplotlib or a similar interactive interface in Microsoft for Python, Build Tools is needed, not only Microsoft C++ Redistributable.
If you are using the Python version that comes with your Linux distribution, you can install Matplotlib via your package manager, e.g.: Debian / Ubuntu: sudo apt-get install python3-matplotlib. Fedora: sudo dnf install python3-matplotlib. Red Hat: sudo yum install python3-matplotlib.
Install matplotlib by entering its name into the search field and then selecting the Run command: pip install matplotlib option. Running the command will install matplotlib , and any packages it depends on (in this case that includes numpy ). Choose the Packages tab. Consent to elevation if prompted to do so.
I don't know the actual reason but I restarted the kernel and it is working.
Before restarting the kernel I executed following commands:
conda install -c anaconda pandas-profiling
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With