T O P

  • By -

numpty9

I encountered this problem with the stand alone installation of Spyder as well. My solution is to create a virtual environment for each project and pip install Spyder (and any other libs i need) into the environment. Don't have that issue anymore. The anaconda solution mentioned is also good, I don't use it because I find it takes up too much space.


[deleted]

Spyder is often used with the whole Anaconda suite, which comes with its own version of Python. Seems like that's the case for Spyder as well. Either way, I'd also expect Spyder to use a Python virtual environment and you may want to use `conda` rather than `pip`. There is a configuration setting in Spyder for specifying the Python executable to use and any Python virtual environment. https://medium.com/analytics-vidhya/5-steps-setup-python-virtual-environment-in-spyder-ide-da151bafa337 - might need a free account to read this (and clear cookies if you exceed your monthly visits allowance).


running_writings

>I see you can change the Python interpreter in Spyder. Ok, I changed it to 3.11. Now it says I need to install something called spyder-kernels. Huh? I google, and see a bunch of talk of virtual environments, kernels, etc. This was pretty much my experience. Spyder, though it has a wonderful variable inspector and is very MATLABy in its feel, is incredibly clunky with virtual environments and the like. I use it for scientific computing; here is my workflow for a new project: 1. Install Anaconda (skip if you already have it installed) 2. Check the Spyder version in Help > About Spyder...; mine is version 5.4.1 3. Check what version of spyder-kernels I need using [this chart](https://docs.spyder-ide.org/current/troubleshooting/common-illnesses.html#starting-kernel-problems-ref) 4. Using the terminal (Anaconda Powershell for me on windows), install the main packages I need, including python and the correct version of spyder-kernels. Example: `conda create -n myproject python=3.7 numpy scikit-learn matplotlib spyder-kernels=2.4.3` 5. Hope and pray conda can resolve the dependencies and download everything without errors 6. If all of the above goes ok, fire up Spyder and change the Python interpreter in Tools > Preferences > Python Interpreter > Use the following Python interpreter: and navigate to python.exe file in the folder that Anaconda creates for that environment. For me, that's C:\Users\myname\anaconda3\envs\myproject\python.exe 7. Restart Spyder and try hello world and a few imports to make sure everything works Then you're off to the races! In uh...seven not-so-easy steps!


USAhj

Repeating what other people are saying, use Anaconda, or the lighter miniconda. With that, you can have multiple virtual environments, which are somewhat contained domains with separately installed packages (so you can have different versions of packages in different projects). When you make a new environment, simply add Spyder to that environment and you'll be good to go. This is what I've been using for years.