228

I want to install the 'rope' package in my current active environment using conda. Currently, the following 'rope' versions are available:

(data_downloader)user@user-ThinkPad ~/code/data_downloader $ conda search rope
Using Anaconda Cloud api site https://api.anaconda.org
Fetching package metadata: ....
cached-property              1.2.0                    py27_0  defaults        
                             1.2.0                    py34_0  defaults        
                             1.2.0                    py35_0  defaults        
                             1.3.0                    py27_0  defaults        
                             1.3.0                    py34_0  defaults        
                             1.3.0                    py35_0  defaults        
rope                         0.9.4                    py26_0  defaults        
                             0.9.4                    py27_0  defaults        
                             0.9.4                    py33_0  defaults        
                             0.9.4                    py34_0  defaults        
                             0.9.4                    py26_1  defaults        
                             0.9.4                    py27_1  defaults        
                             0.9.4                    py33_1  defaults        
                             0.9.4                    py34_1  defaults        
                          .  0.9.4                    py35_1  defaults        

I would like to install the following one:

                         1.3.0                    py35_0  defaults        

I've tried all sorts of permutations of 'conda install' which I'm not going to list here because none of them are correct.

I am also not sure what the py35_0 is (I'm assuming this is the version of the python against which the package was built?) and I also don't know what 'defaults' means?

s5s
  • 11,159
  • 21
  • 74
  • 121
  • 4
    did you try `conda install package=version`? e.g. `conda install matplotlib=1.4.3` – Charlie Parker Nov 07 '20 at 16:19
  • 1
    @CharlieParker -- Thanks that worked. I wasn't able to gather that using equals in that fashion would work from reading the help text. -- The help text really made it seem like I would have to somehow correlate the revision number to a version number and specify it that way (with `--revision`). Thanks again! – BrainSlugs83 Jan 31 '21 at 03:20
  • 3
    if you want at least a specific version don't forget the quotes `conda install -y networkx">=2.5"` – Charlie Parker Jul 19 '21 at 16:35

4 Answers4

250

To install a specific package:

conda install <pkg>=<version>

eg:

conda install matplotlib=1.4.3

For more complex expressions, the relation can be quoted:

conda install 'matplotlib>=1.4.3'

# or

conda install "matplotlib>=1.4.3"
Chris
  • 28,822
  • 27
  • 83
  • 158
96

There is no version 1.3.0 for rope. 1.3.0 refers to the package cached-property. The highest available version of rope is 0.9.4.

You can install different versions with conda install package=version. But in this case there is only one version of rope so you don't need that.

The reason you see the cached-property in this listing is because it contains the string "rope": "cached-p rope erty"

py35_0 means that you need python version 3.5 for this specific version. If you only have python3.4 and the package is only for version 3.5 you cannot install it with conda.

I am not quite sure on the defaults either. It should be an indication that this package is inside the default conda channel.

Wombatz
  • 4,958
  • 1
  • 26
  • 35
  • Thanks - yes, I'm starting with conda and totally missed that 'cached-property' is just another package. – s5s Jul 16 '16 at 14:47
  • 3
    @s5s The `defaults` does indicate that the package will be installed from the default package repository. The `pyXY` indicates that that particular package is available for Python X.Y, while the `_Z` indicates the "build number" which is incremented when the way that the package is created is changed, but the actual code in the package is unchanged. – darthbith Jul 21 '16 at 16:53
  • 8
    Command to install specific package `conda install rope=0.9.4` [This is a link to Conda Documentation](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-pkgs.html) – Orthogod Mar 26 '19 at 13:50
  • How can I choose python version? If I want to install with 1.3.0 version of package for python 3.5? – Soonmyun Jang Oct 05 '20 at 09:29
  • 2
    for people looking for an actual answer with executable code: `conda install =` e.g. `conda install matplotlib=1.4.3` – Charlie Parker Jan 04 '21 at 21:41
  • The answer by @jonathan-l below is a more general answer to the general title of the question and is not specific to the `rope` package... https://stackoverflow.com/users/1667163/jonathan-l – Rich Lysakowski PhD Apr 03 '22 at 02:22
95

If any of these characters, '>', '<', '|' or '*', are used, a single or double quotes must be used

conda install [-y] package">=version"
conda install [-y] package'>=low_version, <=high_version'
conda install [-y] "package>=low_version, <high_version"

conda install -y torchvision">=0.3.0"
conda install  openpyxl'>=2.4.10,<=2.6.0'
conda install "openpyxl>=2.4.10,<3.0.0"

where option -y, --yes Do not ask for confirmation.

Here is a summary:

Format         Sample Specification     Results
Exact          qtconsole==4.5.1         4.5.1
Fuzzy          qtconsole=4.5            4.5.0, 4.5.1, ..., etc.
>=, >, <, <=  "qtconsole>=4.5"          4.5.0 or higher
               qtconsole"<4.6"          less than 4.6.0

OR            "qtconsole=4.5.1|4.5.2"   4.5.1, 4.5.2
AND           "qtconsole>=4.3.1,<4.6"   4.3.1 or higher but less than 4.6.0

Potion of the above information credit to Conda Cheat Sheet

Tested on conda 4.7.12

Jonathan L
  • 9,552
  • 4
  • 49
  • 38
0

Conda seems to be spinning for a long time (+5min) in "Solving environment" if I use an exact version:

$ conda install nodejs=18.16.0

It ran much faster if I loosen up the version a bit:

$ conda create -yn node18 'nodejs>=18,<19'

oVo
  • 111
  • 1
  • 3