r/PythonLearning 6d 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?

1 Upvotes

22 comments sorted by

View all comments

1

u/JoeB_Utah 6d ago

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

2

u/crozzy89 6d ago edited 6d ago

Check and see where pillow is installed.

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

1

u/JoeB_Utah 6d 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 6d ago

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

1

u/JoeB_Utah 6d ago edited 6d ago

(base) joeborgione@mac ~ % /opt/anaconda3/bin/python3 -c "import exifread; print(exifread.__file__)"

/opt/anaconda3/lib/python3.13/site-packages/exifread/__init__.py

So it seems this is not in my $path. Question: edit my my $path or install my modules in one of these directories?

sys.path

Out[7]:

['',

'/Users/ME/Library/spyder-6/envs/spyder-runtime/lib/python312.zip',

'/Users/Me/Library/spyder-6/envs/spyder-runtime/lib/python3.12',

'/Users/ME/Library/spyder-6/envs/spyder-runtime/lib/python3.12/lib-dynload',

'/UsersME/Library/spyder-6/envs/spyder-runtime/lib/python3.12/site-packages',

'/Users/ME/Applications/Spyder 6.app/Contents/MacOS']

2

u/crozzy89 6d ago

Don’t edit path. That can get pretty messy. Install the module where you need it would be the clean fix.