Installed Module and ModuleNotFoundError in MacOs Terminal

Viewed 42

This problem has persistently blocked me for months so I'll expose it to you.

I've installed Anaconda while learning Python and it works just fine, but sometimes I want to play around with a script without launching it : I just want to work with the macOs terminal to see results or errors in my scripts.

My problem is that I often stumble upon the ModuleNotFoundError when I try to import modules (keyboard, matplotlib, pandas...) although all are already installed. When I try to install them again, just in case, they always point towards the path /opt/anaconda3/lib/python3.8/site-packages.

On the other hand, using sys.path in Python, one of the path returned is /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages

So the modules are installed and the computer knows where they are : how can I load them in the terminal — and can I even get them to be loaded in there ?

Many thanks for your attention, hope to hear from you!

0 Answers
Related