r/PythonLearning 17h ago

Help Request Can't import module

Mac os Sequoia 15.6

I installed the exifread library using pip as well as conda. In Anaconda Navigator it shows as installed. Using a terminal window I type in:

pip3 show exifread

and it returns

/opt/anaconda3/lib/python3.13/site-packages

I use Spyder (I know, I know: use pycharm or vscode...) I cannot import the module. I get the dreaded

ModuleNotFoundError: No module named ‘exifread’

I recently installed pillow and I can import it just fine with import PIL. Using pip3 show pillow it is the same directory as exifread

What am I missing here?

2 Upvotes

8 comments sorted by

3

u/SCD_minecraft 17h ago

You probably installed it into wrong python

Grab path to your python's executable and in console

path_to_python.exe -m pip install whatever_you_wanted

1

u/crozzy89 13h ago

May check path to python

which python3
which pip3
python3 --version
pip3 --version

1

u/JoeB_Utah 17h ago

Thanks I’ll give it a try. But what I don’t get is pillow imports while Exif won’t.

2

u/crozzy89 13h ago edited 11h ago

Check and see where pillow is installed.

*everywhere as in it very well could be in two places.

1

u/JoeB_Utah 12h ago

As mentioned, the command

pip3 show exifread returns:

/opt/anaconda3/lib/python3.13/site-packages

and pip3 show pillow returns:

/opt/anaconda3/lib/python3.13/site-packages

This is what is so puzzling to me. I used pip to install both of them from a termiminal window.

1

u/crozzy89 11h ago

/opt/anaconda3/bin/python3 -c "import exifread; print(exifread.__file__)"

2

u/crozzy89 11h ago

You may have pillow installed in more than one place. Spyder can run from different environments and interpreters.

So even though your command shows /opt/anaconda3/lib… that doesn’t mean that is where spyder is actually running it from.

Within spyder, run

import sys
print(sys.executable)

That will tell you which interpreter spyder is running to help narrow down the issue.

1

u/atarivcs 10h ago

Within Spyder, run this code:

import sys
print(sys.path)

And show us the output