-1

I just updated Spyder, and now I get an import error for sklearn (scikit-learn) every time I run my code. scikit-learn is installed correctly in my base anaconda environment, which is where I want to run this code. However, Spyder will not let me change my python interpreter preferences. It keeps changing back to its ("same as Spyder's") default, which for some reason is inside a standalone installation of a software package (which does include another copy of python.exe).

How do I change Spyder's default interpreter so its associated with anaconda and not this random software? It definitely used to be correct, I am not sure what happened. Please help. Thank you!

I thought selecting the directory for the appropriate python.exe in anaconda3 would fix it (Tools >> Preferences >> Use the following interpreter:), but every time I restart Spyder or restart the kernel (or just run code) it switches back to what it has listed as its "Internal" interpreter (which is wrong).

I've updated everything and confirmed scikit-learn is installed correctly in my base environment. I do not want to install scikit-learn (or anything else) in the random software environment that Spyder insists on defaulting to.

2
  • You can try activating your conda environment with conda activate <ENVIRONMENT-NAME> and then opening Spyder with spyder. A few other options are listed in the Spyder Docs for opening with Anaconda Navigator. Commented Sep 19 at 20:41
  • Thank you for the suggestion -- I did end up trying that and it didn't work. I had to hard-code the config file and that fixed it. Commented Sep 21 at 23:54

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.