See [this stackoverflow question](https://stackoverflow.com/questions/30170468/how-to-run-spyder-in-virtual-environment) which refers to [this official reference here](https://github.com/spyder-ide/spyder/wiki/Working-with-packages-and-environments-in-Spyder). 1. Spyder should be installed in the base environment. 2. Activate the target environment (e.g. `conda activate py39a`). 3. Install `spyder-kernels` (e.g. `conda install spyder-kernels`) 4. find and copy the path for the python executable inside the environment (`python -c "import sys; print(sys.executable)"`) 5. deactivate the environment (e.g. `conda deactivate`) 6. run Spyder 7. Spyder→Tool→Preferences→Python Interpreter→Use the following interpreter→paste the environment python executable path. 8. Restart the ipython console.