Rich Lysakowski PhD
Rich Lysakowski PhD

Reputation: 3110

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.

Upvotes: 2

Views: 2164

Answers (1)

Rich Lysakowski PhD
Rich Lysakowski PhD

Reputation: 3110

I finally figured it out.

conda install "spyder-kernels>=1.10, <1.11.0"

Then I found an excellent in-depth explanation within another StackOverflow answer that has the specific syntax.

Syntax to conda install a Python package within a specified range

Upvotes: 1

Related Questions