How to conda install a Python package with min and max version range?

I need to know how to use Conda to install a Python package within a specific version range. Specifically, I am using Spyder 4.2.1 and I want to use the spyder-kernels package to change to a Python interpreter in another Conda virtual environment. When I do this I get an error message:

Your Python environment or installation doesn’t have the spyder‑kernels module or the right version of it installed (>= 1.10.0 and < 1.11.0). Without this module is not possible for Spyder to create a console for you.

You can install it by running in a system terminal:

conda install spyder‑kernels

What I tried was: conda install "spyder-kernels<1.11.0" but it threw an error message.

I found instructions for doing this with pip in this question. However, I never use pip within Conda environments unless I want to dead-end my Conda environment.

Read more here: Source link