ImportError: No module named 'matplotlib' because there are two Python

1

Using Python 3, in a jupyter notebook I try to import matplotlib

#!/usr/bin/env python

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
plt.style.use("ggplot")
%matplotlib inline

But he answers:

ImportError                               Traceback (most recent call last)
<ipython-input-4-53aa8d9f8ebb> in <module>()
      3 import pandas as pd
      4 import numpy as np
----> 5 import matplotlib.pyplot as plt
      6 plt.style.use("ggplot")
      7 get_ipython().run_line_magic('matplotlib', 'inline')

ImportError: No module named 'matplotlib'

I think I have two Pythons installed on your machine, one is the standard python that comes with Linux and the second is the one that I installed with the ports (this is the one that has matplotlib installed in your library, the one that comes with Linux does not).

Can you help me fix this problem?

Update 6/01/2018

When I use the following:

#!/usr/bin/env python3

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
plt.style.use("ggplot")
%matplotlib inline

I do not care

    
asked by ThePassenger 05.02.2018 в 19:28
source

0 answers