Posted on:

14 Oct 2022


If you are getting | 'module' object is not callable | (not a question)

Hello everyone,

1.- Some observation I encountered when doing the homework with Python is that when importing matplotlib, please make sure you don't forget to add .pyplot after matplotlib, otherwise you will always encounter an error saying 'module' object is not callable.

2.- Another reason why you might be getting the same error even when importing matplotlib.pyplot appropriately: Assigning a function to a different value (e.g. = 4).
This means that you are using an equal sign between plt.method_name and its parameters between parentheses | plt.figure = (figsize = (15,30) |
Instead of behaving as a function, your function becomes a normal python variable, so it is convenient to re-run the whole kernel instead to restart all variables and re-import the necessary libraries.

Photo below does not show the two assignments. It shows the one from the videos instead. The photo shows only the exercise done with the videos.

0 answers ( 0 marked as helpful)

Submit an answer