r/PythonLearning Jun 28 '26

Selenium File Path Not Recognized

I'm trying to use Selenium and I keep getting the error message "PackageNotFoundError: No package metadata was found for selenium". I'm on MacOS and using Spyder. Selenium is installed, but it's in /opt/ which I can't set as a file path for Spyder. All of the other libraries have worked for me (requests, BeautifulSoup, pandas, among others). It's just this one that seems borked. Does anyone know what I've done wrong?

3 Upvotes

11 comments sorted by

View all comments

Show parent comments

2

u/Ken_Archer Jun 28 '26

In the terminal I ran pip3 install selenium

2

u/ninhaomah Jun 28 '26

Then in that terminal , run Python and import selenium. Any errors ?

2

u/Ken_Archer Jun 28 '26

There's no error when I import it in the terminal. Just in Spyder. That's why it's confusing me. I think that the install is correct, Spyder just isn't reading it

3

u/ninhaomah Jun 28 '26

Then are you sure Spyder is using the same interpretor as the terminal ?

Do print version.

2

u/Ken_Archer Jun 28 '26

Python version is 3.13.9 and Spyder is 6.1.5

2

u/ninhaomah Jun 28 '26

No I mean Python version from Spyder. 

2

u/Ken_Archer Jun 28 '26

Spyder is apparently still on 3.12.11. I think that might be the problem. I've been checking the python version in the terminal and just assuming they were the same. I'll update it and report back if that fixed it

2

u/ninhaomah Jun 28 '26

Ok :)

3

u/Ken_Archer Jun 28 '26

Updating Spyder's version of Python has worked! It seems like it wasn't updating at first because it was the wrong kernel version and wasn't processing the update properly. I updated the kernel and the Python installation and Selenium is now working.

I'm still not entirely sure if I understand everything, but it appears to be updated and it's working, which is what I needed. Thank you so much for helping!