Spyder, spyder-kernels and python version compatibilities?
(Spyder maintainer here) You said
From random blogs and questions on StackOverflow I know that Spyder >= 4 requires Python >= 3
This is incorrect. Spyder 4.1.5 is compatible with Python 2.7. We drop support for Python 2.7 in our 4.2.0 version, released in November 2020.
and spyder-kernels at least 1.9 up (maybe lower, haven't tried all...)
Here you can find the list of spyder-kernels versions that are necessary for different Spyder ones. That needs to be updated for Spyder 5, but we will do that soon.
For Python 2.7 I can only go as far as Spyder 3, but I can't find the proper Spyer-kernels to install.
There's a misunderstanding here. You can still use Spyder 5 (which only supports Python 3) and run your Python 2 code in a different environment with the latest spyder-kernels, which still supports Python 2.7.
For that, first you need to run the following commands
conda create -n py27 python=2.7
conda activate py27
pip install spyder-kernels
It's necessary to use pip to install spyder-kernels because Anaconda and Conda-forge stopped creating packages for Python 2 a long time ago.
Then you need to connect Spyder to that env by following these instructions.
Which spyder-kernels do I need for installing spyder3 in a python 2.7 environment?
You don't need to do that, according to what I mentioned above.
Switch between spyder for python 2 and 3
Spyder is launched from the environment that you're using.
So if you want to use python 3 in Spyder then you activate python34
(or whatever you named the environment with Python 3) then run spyder
.
If you want to use python 2 in Spyder then you deactivate
the python3 environment (or activate
an environment in which you installed Python 2) then run spyder
.
I do not believe that you can change environments once Spyder is launched.
N.B. you may need to install Spyder in each environment, depending on your set up, by first activating the environment then using conda install spyder
.
how to update spyder on anaconda
To expand on juanpa.arrivillaga's comment:
If you want to update Spyder in the root environment, then conda update spyder
works for me.
If you want to update Spyder for a virtual environment you have created (e.g., for a different version of Python), then conda update -n $ENV_NAME spyder
where $ENV_NAME
is your environment name.
EDIT: In case conda update spyder
isn't working, this post indicates you might need to run conda update anaconda
before updating spyder. Also note that you can specify an exact spyder version if you want.
Related Topics
Receiving Integers from the User Until They Enter 0
How to Convert Datetime by Removing Nanoseconds
How to Transfer Data from One Worksheet into Another Using Python in the Same Workbook
How to Convert a 1 Channel Image into a 3 Channel With Opencv2
Find the Item With Maximum Occurrences in a List
Python 3 Error - Typeerror: Input Expected At Most 1 Arguments, Got 3
Plot Different Dataframes in the Same Figure
Combine Date and Time Columns Using Python Pandas
How to Remove Nan from List Python/Numpy
I Want to Reshape 2D Array into 3D Array
How to Download the Latest File of an S3 Bucket Using Boto3
How to Stop a Running Function Without Exiting the Tkinter Window Entirely