Python – “No module named ‘ stem ‘”in Python3 on macOS

“No module named ‘ stem ‘”in Python3 on macOS… here is a solution to the problem.

“No module named ‘ stem ‘”in Python3 on macOS

Apologies for the rookie question.
I’m trying to run a script that uses the stem module. However, whenever I run it, I get the warning “ModuleNotFoundError: No module named ‘stem'”

Even though I’m using Python3 in the terminal, this issue happens with a simple try:

In [1]: import stem
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-1-e9a7ebd02e09> in <module>()
----> 1 import stem

ModuleNotFoundError: No module named 'stem'

Why is this?
I’m using macOS 10.12.6. I also imported STEM through the terminal.

Solution

Run it to fix the problem:

pip3 install stemming

Related Problems and Solutions