Is there a "conda requires ..." command?

0 views
Skip to first unread message

Skip Montanaro

unread,
May 9, 2017, 12:26:50 PM5/9/17
to conda - Public
I'm in need of something approximating a "conda requires" command.
During upgrade of an internal package, conda told me it was
downgrading icu from 56.x to 54.y. I'd like to know what of my
installed packages depend on either of these two versions.

I managed to manually dig out a dependency of r-base on icu 54.*. Not
needing R (I thought I had removed all its bits recently, but this
apparently lingered around), I removed r-base. That may have solved my
problem, but I didn't find a dependency on 56.* anywhere. How can I
tell what of my installed packages might have any dependency on icu
(and on which versions)?

Thx,

Skip Montanaro

Allison

unread,
May 9, 2017, 12:34:16 PM5/9/17
to conda - Public
Hello,

Have you tried using
conda info package_name=version_number
?

It will give you dependency info. 

You can also look at the json for individual packages and see their dependencies. 
 ~/anaconda/pkgs/package_name/info/index.json


Best,

Ally

Ian Stokes Rees

unread,
May 9, 2017, 12:46:30 PM5/9/17
to co...@continuum.io
Ally,

I think the problem Skip is having is the one I've documented here:

https://github.com/conda/conda/issues/4942

He doesn't want to go through every package to find out which one has icu 56 as a dependency, he wants to go the other way and say "which packages require icu".  At least that is my reading of his question.

I often want to do that as well, and there is, so far as I'm aware, no good way to do that today.

Ian

Skip Montanaro

unread,
May 9, 2017, 1:42:05 PM5/9/17
to Ian Stokes Rees, conda - Public
On Tue, May 9, 2017 at 11:46 AM, Ian Stokes Rees <ijst...@continuum.io> wrote:
> He doesn't want to go through every package to find out which one has icu 56
> as a dependency, he wants to go the other way and say "which packages
> require icu".

Correctamundo.

Skip

Chris Barker

unread,
May 9, 2017, 4:50:22 PM5/9/17
to Skip Montanaro, Ian Stokes Rees, conda - Public
This is a pretty common use case for debugging dependency issues.

IT would be pretty esy to write a script that:

calls

$ conda list

To get all the packages installed

Loops through that list and calls

$ conda info package_name=version

on each one, and builds up a dependency list.

But it would be nicer to use the conda API, rather than parsing command line output to do it. And then maybe it could be added to conda itself one day.

Anyone care to point us to the APIs to use?

-CHB

--

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris....@noaa.gov

Amir Mohammadi

unread,
May 9, 2017, 4:59:13 PM5/9/17
to Chris Barker, Skip Montanaro, Ian Stokes Rees, conda - Public

There is a script in conda forge that does this https://github.com/conda-forge/conda-forge.github.io/blob/master/scripts/list_deps.py

Best,
Amir


--
You received this message because you are subscribed to the Google Groups "conda - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to conda+un...@continuum.io.
To post to this group, send email to co...@continuum.io.
Visit this group at https://groups.google.com/a/continuum.io/group/conda/.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/conda/CALGmxEJ0dPXCC_asN9SYnhCdB-kVVtdtpkA5XTuz5iz1irivLg%40mail.gmail.com.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Kale Franz

unread,
May 9, 2017, 5:00:40 PM5/9/17
to Chris Barker, Skip Montanaro, Ian Stokes Rees, conda - Public
Anyone care to point us to the APIs to use?

Honestly, not particularly 😜

Right now it looks like the code here is some pretty simple filtering after a call to `get_index()`.  All of the relevant code is in conda/cli/main_search.py.

The reason I say not particularly is because Stefan Seefeld is heading up a pretty large API project to flesh out exactly what the in-code coda APIs should look like and be.  We're doing this within the current code base, and not as a separate library.  The API will be built along with and within the normal conda feature releases.  When we're happy with it and we feel like it's stabilized, we'll declare a conda 5.0 with a pretty strict contract for what we identify as an API-level function, method, exception, etc. etc.

--
You received this message because you are subscribed to the Google Groups "conda - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to conda+un...@continuum.io.
To post to this group, send email to co...@continuum.io.
Visit this group at https://groups.google.com/a/continuum.io/group/conda/.



--
Kale J. Franz, PhD
Conda Tech Lead


221 W 6th St | Suite 1550 | Austin, TX 78701

Ian Stokes Rees

unread,
May 9, 2017, 6:14:18 PM5/9/17
to Kale Franz, Chris Barker, Skip Montanaro, conda - Public


On 5/9/17 5:00 PM, Kale Franz wrote:
Anyone care to point us to the APIs to use?

Honestly, not particularly 😜

Right now it looks like the code here is some pretty simple filtering after a call to `get_index()`.  All of the relevant code is in conda/cli/main_search.py.

The reason I say not particularly is because Stefan Seefeld is heading up a pretty large API project to flesh out exactly what the in-code coda APIs should look like and be.  We're doing this within the current code base, and not as a separate library.  The API will be built along with and within the normal conda feature releases.  When we're happy with it and we feel like it's stabilized, we'll declare a conda 5.0 with a pretty strict contract for what we identify as an API-level function, method, exception, etc. etc.

Hallelujah!  I've been waiting almost 4 years for this.

And in the mean time, the "API" is parsing the CLI output of `conda` commands which have the `--json` flag added to them (yes, that is what people at Continuum do as well).

Ian

Chris Barker - NOAA Federal

unread,
May 9, 2017, 7:36:08 PM5/9/17
to Ian Stokes Rees, Kale Franz, Skip Montanaro, conda - Public
> And in the mean time, the "API" is parsing the CLI output of `conda` commands which have the `--json` flag added to them

Hacky, but effective. I hadn't noticed the --json flag -- that makes
it pretty easy.

-CHB

Skip Montanaro

unread,
May 9, 2017, 7:58:21 PM5/9/17
to Amir Mohammadi, Chris Barker, Ian Stokes Rees, conda - Public
On Tue, May 9, 2017 at 3:59 PM, Amir Mohammadi <183....@gmail.com> wrote:
> There is a script in conda forge that does this
> https://github.com/conda-forge/conda-forge.github.io/blob/master/scripts/list_deps.py

Thanks, Amir. I can't get it to run with Python 2 or 3, and don't seem
to have a conda-execute command. The conda command doesn't understand
an execute subcommand either.

Skip Montanaro

Skip Montanaro

unread,
May 9, 2017, 8:01:31 PM5/9/17
to Chris Barker, Ian Stokes Rees, conda - Public
On Tue, May 9, 2017 at 3:49 PM, Chris Barker <chris....@noaa.gov> wrote:
> This is a pretty common use case for debugging dependency issues.

I rather like Ubuntu's

apt autoremove

command, which will remove packages on which no other packages depend
(and presumably provide no shell level commands). A "requires" command
would seem to use similar information.

Skip

Kale Franz

unread,
May 9, 2017, 8:03:57 PM5/9/17
to Skip Montanaro, Chris Barker, Ian Stokes Rees, conda - Public
We have a `--prune` flag coming to remove leaf nodes originally brought in as dependencies but now no longer needed by the cumulative user requests that built the environment.

--
You received this message because you are subscribed to the Google Groups "conda - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to conda+un...@continuum.io.
To post to this group, send email to co...@continuum.io.
Visit this group at https://groups.google.com/a/continuum.io/group/conda/.

Travis Oliphant

unread,
May 10, 2017, 1:28:30 AM5/10/17
to Chris Barker, Skip Montanaro, Ian Stokes Rees, conda - Public
Michael Grant offers this solution: 

conda search --reverse-dependency --full-name <package_name>

The --full-name flag just makes sure it doesn't match, say, "icuabc".
-Travis



--
You received this message because you are subscribed to the Google Groups "conda - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to conda+un...@continuum.io.
To post to this group, send email to co...@continuum.io.
Visit this group at https://groups.google.com/a/continuum.io/group/conda/.



--
Continuum Analytics Banner

Travis Oliphant
President, Chief Data Scientist & Co-Founder
C: 512-826-7480 
E: tra...@continuum.io 
@ContinuumIO @teoliphant

Anaconda Powered By Continuum Analytics
Follow us on TwitterConnect with us on LinkedInSubscribe to our Youtube channelConnect with us on SlideShare


Skip Montanaro

unread,
May 10, 2017, 10:07:30 AM5/10/17
to Travis Oliphant, Chris Barker, Ian Stokes Rees, conda - Public

On Wed, May 10, 2017 at 12:28 AM, Travis Oliphant <tra...@continuum.io> wrote:
Michael Grant offers this solution: 

conda search --reverse-dependency --full-name <package_name>

The --full-name flag just makes sure it doesn't match, say, "icuabc".
-Travis

Thanks, Travis. That does most everything I needed. The one thing it doesn't do is specify version info (and potential conflicts). Still, that gets me a lot closer.

My problem turned out to be (I think) that I had r-base 3.3.2 and libxml2 2.9.3 installed. The former depended on icu 54.* and some flavor of libxml2, while the latter depended on icu 56.*. The icu version conflict seems to have been resolved in libxml2 2.9.4, where the icu dependency was removed.

Skip
Reply all
Reply to author
Forward
0 new messages