Skip to content
Advertisement

Trying to resolve ModuleNotFoundError: No module named

Trying to install third party modules on my mac using pip and I am getting this error (Using IDLE as the Python shell):

JavaScript

(Have tried multiple modules and all return the same error)

I have installed the modules using:

JavaScript

I can see that it has installed into the directory:

JavaScript

Ive tried going through several of the posts posted on StackOverflow such as this and this but after trying their steps I cant seem to resolve it.

which -a pip3 gives:

JavaScript

which -a python3 gives:

JavaScript

print(sys.version) gives:

JavaScript

pip –version gives:

JavaScript

Running /usr/local/bin/python3 test1.py:

JavaScript

Thanks

Advertisement

Answer

You can run this command for seeing pip3 uses which python:

JavaScript

But i guess you are not choosing right python to run your .py file

if you run your .py like this:

JavaScript

You must be sure pip3 installing libraries to ‘python3’ linked python or you can run your main.py file with one of pip3 linked python

I mean if pip3 –version gives you

JavaScript

this python path you can run your main.py like this

JavaScript

but if you want to use best practice i recommend to you using virtualenv

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement