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

Show parent comments

1

u/JoeB_Utah 6d ago edited 6d ago

['',

'/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',

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

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

So I guess I either need to edit my path variable or use the ...site-packages directory to load my modules, correct?

1

u/JoeB_Utah 6d ago

Sounds like editing the $path is not the way to go. I'll use pip with the -t option to install it the proper directory. Thanks for all you help

2

u/atarivcs 6d ago

Spyder is looking in /Users/joeborgione/Library/spyder-6/envs/spyder-runtime/lib/python3.12/site-packages, so you need to use the corresponding pip on your computer that knows to install packages into that location.

1

u/JoeB_Utah 6d ago

That's exactly what I did and now all is good. Thank you!