Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing specific BUILD of an anaconda package

Is there any way to install a specific build+version of a package in Anaconda? Stack Overflow post "anaconda/conda - install a specific package version" shows how to install a specific version of the package. But look below--there are several pillow packages version 4.2.1 that has "py27" prefix on it.

Background: I am scratching my head to figure the meaning of "conda search" output. For example, on my installation, conda search pillow gives:

pillow                       2.1.0                    py26_0  defaults
...
                          *  3.3.1                    py27_0  defaults        
                             3.3.1                    py34_0  defaults        
                             3.3.1                    py35_0  defaults        
....
                             4.2.1                    py27_0  defaults        
                             4.2.1                    py35_0  defaults        
                             4.2.1                    py36_0  defaults        
                             4.2.1            py27h7cd2321_0  defaults        
                             4.2.1            py35h03abc04_0  defaults        
                             4.2.1            py36h9119f52_0  defaults        
                             4.3.0            py35h550890c_1  defaults        
                             4.3.0            py27h353bd0c_1  defaults        
                             4.3.0            py36h6f462bf_1  defaults        

I understand the meaning of 2.1.0, 3.3.1, and so on--the version numbers. But what do py27_0 and defaults mean? More mind boggling was new appearance of the trailing hex numbers like in py27h7cd2321_0 . After researching some more:

https://www.anaconda.com/blog/developer-blog/package-better-conda-build-3/

tells me that that's a new way to encode the specific build of the package.

So back to my question: given that I'm still on Python 2.7 line of anaconda, how do we choose the py27_0 build instead of the other one (py27h7cd2321_0) when we do conda install?

like image 215
Wirawan Purwanto Avatar asked Jan 06 '18 13:01

Wirawan Purwanto


1 Answers

The column with py27_0 is what build/version of python it is for. The column with defaults is to indicate which Anaconda channel it falls under. Different users or organizations can have their own channels but the default channel is defaults and another popular channel is conda-forge.

The way you install any specific version from that information is:

conda install pillow=4.2.1=py27h7cd2321_0

Which is of the format

conda install <package_name>=<version>=<build_string>

If you want to choose which channel (otherwise defaults is chosen by default):

conda install -c <channel> <package_name>=<version>=<build_string>
like image 142
nitred Avatar answered Oct 13 '22 14:10

nitred