0

I've just started studying python and I really liked blessed looked like and wanted to give it a try.

I installed it using pip install blessed on the console and then I copied the following code from their site:

import os
import sys

print('Test run')

try:
    from blessed import Terminal
except ModuleNotFoundError:
    print('Could find the import :(')

After running the code, I receive the 'ModuleNotFoundError' exception.

How do I proper install blessed to avoid this error?

-- Edit

After some research turns out that py -m pip install blessed solved my problem.

Even though it is working now, what is the difference between using py -m pip install blessed and pip install blessed, which is what I used before?

ElPanda
  • 1
  • 2

1 Answers1

0

Your edit suggests that your system's pip command runs pip for a different interpreter than the one you get by default when you run py (which is probably what you were using to run your script too). Each interpreter installed on your system will have its own set of installed modules, and it's own pip program to manage them. One interpreter usually can't use the modules installed for a different interpreter.

Blckknght
  • 100,903
  • 11
  • 120
  • 169