Identifying the dependency relationship for python packages installed with pipIs there a way to list pip dependencies/requirements?Listing the dependencies of a package using piplist python package dependencies without loading them?How can I see all packages that depend on a certain package with PIP?python setup.py py2exe Invalid Syntax (asyncsupport.py, line 22)Upgrading all packages with pipInstall a Python package into a different directory using pip?How do I install pip on Windows?pip install mysql-python fails with EnvironmentError: mysql_config not foundInstalling specific package versions with pipHow to install psycopg2 with “pip” on Python?How to install packages using pip according to the requirements.txt file from a local directory?Find which version of package is installed with pipHow do I install pip on macOS or OS X?How do I install a Python package with a .whl file?

In 'Revenger,' what does 'cove' come from?

Do UK voters know if their MP will be the Speaker of the House?

Is there a hemisphere-neutral way of specifying a season?

What do you call someone who asks many questions?

Is it acceptable for a professor to tell male students to not think that they are smarter than female students?

Forgetting the musical notes while performing in concert

How can saying a song's name be a copyright violation?

Why would the Red Woman birth a shadow if she worshipped the Lord of the Light?

Bullying boss launched a smear campaign and made me unemployable

Why is this clock signal connected to a capacitor to gnd?

Why didn't Boeing produce its own regional jet?

Why doesn't using multiple commands with a || or && conditional work?

What reasons are there for a Capitalist to oppose a 100% inheritance tax?

What killed these X2 caps?

What is a romance in Latin?

Is it inappropriate for a student to attend their mentor's dissertation defense?

How could indestructible materials be used in power generation?

What does “the session was packed” mean in this context?

Why didn't Miles's spider sense work before?

How do I handle a potential work/personal life conflict as the manager of one of my friends?

ssTTsSTtRrriinInnnnNNNIiinngg

Can we compute the area of a quadrilateral with one right angle when we only know the lengths of any three sides?

Can compressed videos be decoded back to their uncompresed original format?

Zip/Tar file compressed to larger size?



Identifying the dependency relationship for python packages installed with pip


Is there a way to list pip dependencies/requirements?Listing the dependencies of a package using piplist python package dependencies without loading them?How can I see all packages that depend on a certain package with PIP?python setup.py py2exe Invalid Syntax (asyncsupport.py, line 22)Upgrading all packages with pipInstall a Python package into a different directory using pip?How do I install pip on Windows?pip install mysql-python fails with EnvironmentError: mysql_config not foundInstalling specific package versions with pipHow to install psycopg2 with “pip” on Python?How to install packages using pip according to the requirements.txt file from a local directory?Find which version of package is installed with pipHow do I install pip on macOS or OS X?How do I install a Python package with a .whl file?













103















When I do a pip freeze I see large number of Python packages that I didn't explicitly install, e.g.



$ pip freeze
Cheetah==2.4.3
GnuPGInterface==0.3.2
Landscape-Client==11.01
M2Crypto==0.20.1
PAM==0.4.2
PIL==1.1.7
PyYAML==3.09
Twisted-Core==10.2.0
Twisted-Web==10.2.0
(etc.)


Is there a way for me to determine why pip installed these particular dependent packages? In other words, how do I determine the parent package that had these packages as dependencies?



For example, I might want to use Twisted and I don't want to depend on a package until I know more about not accidentally uninstalling it or upgrading it.










share|improve this question


























    103















    When I do a pip freeze I see large number of Python packages that I didn't explicitly install, e.g.



    $ pip freeze
    Cheetah==2.4.3
    GnuPGInterface==0.3.2
    Landscape-Client==11.01
    M2Crypto==0.20.1
    PAM==0.4.2
    PIL==1.1.7
    PyYAML==3.09
    Twisted-Core==10.2.0
    Twisted-Web==10.2.0
    (etc.)


    Is there a way for me to determine why pip installed these particular dependent packages? In other words, how do I determine the parent package that had these packages as dependencies?



    For example, I might want to use Twisted and I don't want to depend on a package until I know more about not accidentally uninstalling it or upgrading it.










    share|improve this question
























      103












      103








      103


      28






      When I do a pip freeze I see large number of Python packages that I didn't explicitly install, e.g.



      $ pip freeze
      Cheetah==2.4.3
      GnuPGInterface==0.3.2
      Landscape-Client==11.01
      M2Crypto==0.20.1
      PAM==0.4.2
      PIL==1.1.7
      PyYAML==3.09
      Twisted-Core==10.2.0
      Twisted-Web==10.2.0
      (etc.)


      Is there a way for me to determine why pip installed these particular dependent packages? In other words, how do I determine the parent package that had these packages as dependencies?



      For example, I might want to use Twisted and I don't want to depend on a package until I know more about not accidentally uninstalling it or upgrading it.










      share|improve this question














      When I do a pip freeze I see large number of Python packages that I didn't explicitly install, e.g.



      $ pip freeze
      Cheetah==2.4.3
      GnuPGInterface==0.3.2
      Landscape-Client==11.01
      M2Crypto==0.20.1
      PAM==0.4.2
      PIL==1.1.7
      PyYAML==3.09
      Twisted-Core==10.2.0
      Twisted-Web==10.2.0
      (etc.)


      Is there a way for me to determine why pip installed these particular dependent packages? In other words, how do I determine the parent package that had these packages as dependencies?



      For example, I might want to use Twisted and I don't want to depend on a package until I know more about not accidentally uninstalling it or upgrading it.







      python pip






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Feb 10 '12 at 18:04









      Mark ChackerianMark Chackerian

      9,40047270




      9,40047270






















          7 Answers
          7






          active

          oldest

          votes


















          117














          You could try pipdeptree which displays dependencies as a tree structure e.g.:



          $ pipdeptree
          Lookupy==0.1
          wsgiref==0.1.2
          argparse==1.2.1
          psycopg2==2.5.2
          Flask-Script==0.6.6
          - Flask [installed: 0.10.1]
          - Werkzeug [required: >=0.7, installed: 0.9.4]
          - Jinja2 [required: >=2.4, installed: 2.7.2]
          - MarkupSafe [installed: 0.18]
          - itsdangerous [required: >=0.21, installed: 0.23]
          alembic==0.6.2
          - SQLAlchemy [required: >=0.7.3, installed: 0.9.1]
          - Mako [installed: 0.9.1]
          - MarkupSafe [required: >=0.9.2, installed: 0.18]
          ipython==2.0.0
          slugify==0.0.1
          redis==2.9.1


          To get it run:



          pip install pipdeptree



          EDIT: as noted by @Esteban in the comments you can also list the tree in reverse with -r or for a single package with -p <package_name> so to find what installed Werkzeug you could run:



          $ pipdeptree -r -p Werkzeug
          Werkzeug==0.11.15
          - Flask==0.12 [requires: Werkzeug>=0.7]





          share|improve this answer




















          • 5





            I believe to fully answer @mark 's question you would need to run: pipdeptree -r "Shows the dependency tree in the reverse fashion ie. the sub-dependencies are listed with the list of packages that need them under them."

            – Esteban
            Jul 26 '16 at 21:28












          • Similar project: github.com/rbanffy/pip-chill

            – Ben Creasy
            Jun 23 '17 at 4:32











          • How can you view the reverse tree for all PyPi packages, not only the locally installed packages?

            – Tijme
            Jul 18 '17 at 16:16






          • 1





            pipdeptree is great. Unfortunately it does not appear to take into account dependencies for packages installed by conda: e.g. in a conda env where matplotlib and numpy were installed using pip, but scipy was installed using conda, scipy shows up in the pipdeptree as having no depencies and no dependents (also pip show scipy shows no requirements).

            – djvg
            Sep 27 '18 at 9:01












          • @Dennis I've not tried it but this might work for conda github.com/rvalieris/conda-tree

            – djsutho
            Oct 5 '18 at 2:05


















          64














          The pip show command will show what packages are required for the specified package (note that the specified package must already be installed):



          $ pip show specloud

          Package: specloud
          Version: 0.4.4
          Requires:
          nose
          figleaf
          pinocchio


          pip show was introduced in pip version 1.4rc5






          share|improve this answer




















          • 1





            pip show was introduced in version 1.4rc5, and is present in the (current as of writing) 1.4.1

            – drevicko
            Oct 23 '13 at 2:52






          • 8





            This doesn't answer my question exactly, because it shows the children (dependencies) for a specific package, instead of the parents. But it's easy enough to throw something together to check the dependencies of each package, using this command. So, for example, I could determine which installed package required PyYAML.

            – Mark Chackerian
            Feb 21 '14 at 9:27






          • 4





            As per my previous comment, this shell command dumps out all of the dependencies for each of my installed packages: $ pip freeze | grep -v "-e" | sed s/==.*// | awk 'system("pip show " $1)'

            – Mark Chackerian
            Feb 21 '14 at 15:15











          • An updated version of the script from my previous comment is pip freeze | grep -v "-e" | sed s/==.*// | awk 'system("pip show " $1)' | grep -E '^(Name:|Requires:)' | sed s/Name:/\nName:/ -- but it seems that pipdeptree is now a better solution.

            – Mark Chackerian
            Aug 3 '17 at 15:26


















          12














          As I recently said on a hn thread, I'll recommend the following:



          Have a commented requirements.txt file with your main dependencies:



          ## this is needed for whatever reason
          package1


          Install your dependencies: pip install -r requirements.txt.
          Now you get the full list of your dependencies with pip freeze -r requirements.txt:



          ## this is needed for whatever reason
          package1==1.2.3

          ## The following requirements were added by pip --freeze:
          package1-dependency1==1.2.3
          package1-dependency1==1.2.3


          This allows you to keep your file structure with comments, nicely separating your dependencies from the dependencies of your dependencies. This way you'll have a much nicer time the day you need to remove one of them :)



          Note the following:



          • You can have a clean requirements.raw with version control to rebuild your full requirements.txt.

          • Beware of git urls being replaced by egg names in the process.

          • The dependencies of your dependencies are still alphabetically sorted so you don't directly know which one was required by which package but at this point you don't really need it.

          • Use pip install --no-install <package_name> to list specific requirements.

          • Use virtualenv if you don't.





          share|improve this answer




















          • 1





            I just don't understand why this pip freeze -r requirements.txt is not widely used. Very useful for maintaining the dependencies and sub dependencies.

            – Penkey Suresh
            Jul 3 '17 at 8:43











          • minor note: pip install no longer supports --no-install.

            – ryan
            Oct 11 '18 at 16:18


















          5














          You may also use a one line command which pipes the packages in requirements to pip show.



          cut -d'=' -f1 requirements.txt | xargs pip show





          share|improve this answer


















          • 1





            Generally you can't as the format of requirements.txt is more complex than <package_name>==<package_version>.

            – Piotr Dobrogost
            Mar 25 '16 at 7:33


















          3














          First of all pip freeze displays all currently installed packages Python, not necessarily using PIP.



          Secondly Python packages do contain the information about dependent packages as well as required versions. You can see the dependencies of particular pkg using the methods described here. When you're upgrading a package the installer script like PIP will handle the upgrade of dependencies for you.



          To solve updating of packages i recommend using PIP requirements files. You can define what packages and versions you need, and install them at once using pip install.






          share|improve this answer
































            1














            I wrote a quick script to solve this problem. The following script will display the parent (dependant) package(s) for any given package. This way you can be sure it is safe to upgrade or install any particular package. It can be used as follows: dependants.py PACKAGENAME



            #!/usr/bin/env python3
            # -*- coding: utf-8 -*-

            """Find dependants of a Python package"""

            import logging
            import pip
            import pkg_resources
            import sys

            __program__ = 'dependants.py'


            def get_dependants(target_name):
            for package in pip._internal.utils.misc.get_installed_distributions():
            for requirement_package in package.requires():
            requirement_name = requirement_package.project_name
            if requirement_name == target_name:
            yield package.project_name


            # configure logging
            logging.basicConfig(format='%(levelname)s: %(message)s',
            level=logging.INFO)

            try:
            target_name = sys.argv[1]
            except IndexError:
            logging.error('missing package name')
            sys.exit(1)

            try:
            pkg_resources.get_distribution(target_name)
            except pkg_resources.DistributionNotFound:
            logging.error("'%s' is not a valid package", target_name)
            sys.exit(1)

            print(list(get_dependants(target_name)))





            share|improve this answer

























            • This no longer works because the get_installed_distributions() method is no longer available. github.com/pypa/pip/issues/5243

              – Phil Gyford
              Mar 7 at 14:55


















            0














            (workaround, not true answer)



            Had the same problem, with lxml not installing and me wanting to know who needed lxml. Not who lxml needed. Ended up bypassing the issue by.



            1. noting where my site packages were being put.


            2. go there and recursive grep for the import (the last grep's --invert-match serves to remove lxml's own files from consideration).


            Yes, not an answer as to how to use pip to do it, but I didn't get any success out of the suggestions here, for whatever reason.



             site-packages me$ egrep -i --include=*.py -r -n lxml . | grep import | grep --invert-match /lxml/





            share|improve this answer























              Your Answer






              StackExchange.ifUsing("editor", function ()
              StackExchange.using("externalEditor", function ()
              StackExchange.using("snippets", function ()
              StackExchange.snippets.init();
              );
              );
              , "code-snippets");

              StackExchange.ready(function()
              var channelOptions =
              tags: "".split(" "),
              id: "1"
              ;
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function()
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled)
              StackExchange.using("snippets", function()
              createEditor();
              );

              else
              createEditor();

              );

              function createEditor()
              StackExchange.prepareEditor(
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader:
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              ,
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );













              draft saved

              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f9232568%2fidentifying-the-dependency-relationship-for-python-packages-installed-with-pip%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              7 Answers
              7






              active

              oldest

              votes








              7 Answers
              7






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              117














              You could try pipdeptree which displays dependencies as a tree structure e.g.:



              $ pipdeptree
              Lookupy==0.1
              wsgiref==0.1.2
              argparse==1.2.1
              psycopg2==2.5.2
              Flask-Script==0.6.6
              - Flask [installed: 0.10.1]
              - Werkzeug [required: >=0.7, installed: 0.9.4]
              - Jinja2 [required: >=2.4, installed: 2.7.2]
              - MarkupSafe [installed: 0.18]
              - itsdangerous [required: >=0.21, installed: 0.23]
              alembic==0.6.2
              - SQLAlchemy [required: >=0.7.3, installed: 0.9.1]
              - Mako [installed: 0.9.1]
              - MarkupSafe [required: >=0.9.2, installed: 0.18]
              ipython==2.0.0
              slugify==0.0.1
              redis==2.9.1


              To get it run:



              pip install pipdeptree



              EDIT: as noted by @Esteban in the comments you can also list the tree in reverse with -r or for a single package with -p <package_name> so to find what installed Werkzeug you could run:



              $ pipdeptree -r -p Werkzeug
              Werkzeug==0.11.15
              - Flask==0.12 [requires: Werkzeug>=0.7]





              share|improve this answer




















              • 5





                I believe to fully answer @mark 's question you would need to run: pipdeptree -r "Shows the dependency tree in the reverse fashion ie. the sub-dependencies are listed with the list of packages that need them under them."

                – Esteban
                Jul 26 '16 at 21:28












              • Similar project: github.com/rbanffy/pip-chill

                – Ben Creasy
                Jun 23 '17 at 4:32











              • How can you view the reverse tree for all PyPi packages, not only the locally installed packages?

                – Tijme
                Jul 18 '17 at 16:16






              • 1





                pipdeptree is great. Unfortunately it does not appear to take into account dependencies for packages installed by conda: e.g. in a conda env where matplotlib and numpy were installed using pip, but scipy was installed using conda, scipy shows up in the pipdeptree as having no depencies and no dependents (also pip show scipy shows no requirements).

                – djvg
                Sep 27 '18 at 9:01












              • @Dennis I've not tried it but this might work for conda github.com/rvalieris/conda-tree

                – djsutho
                Oct 5 '18 at 2:05















              117














              You could try pipdeptree which displays dependencies as a tree structure e.g.:



              $ pipdeptree
              Lookupy==0.1
              wsgiref==0.1.2
              argparse==1.2.1
              psycopg2==2.5.2
              Flask-Script==0.6.6
              - Flask [installed: 0.10.1]
              - Werkzeug [required: >=0.7, installed: 0.9.4]
              - Jinja2 [required: >=2.4, installed: 2.7.2]
              - MarkupSafe [installed: 0.18]
              - itsdangerous [required: >=0.21, installed: 0.23]
              alembic==0.6.2
              - SQLAlchemy [required: >=0.7.3, installed: 0.9.1]
              - Mako [installed: 0.9.1]
              - MarkupSafe [required: >=0.9.2, installed: 0.18]
              ipython==2.0.0
              slugify==0.0.1
              redis==2.9.1


              To get it run:



              pip install pipdeptree



              EDIT: as noted by @Esteban in the comments you can also list the tree in reverse with -r or for a single package with -p <package_name> so to find what installed Werkzeug you could run:



              $ pipdeptree -r -p Werkzeug
              Werkzeug==0.11.15
              - Flask==0.12 [requires: Werkzeug>=0.7]





              share|improve this answer




















              • 5





                I believe to fully answer @mark 's question you would need to run: pipdeptree -r "Shows the dependency tree in the reverse fashion ie. the sub-dependencies are listed with the list of packages that need them under them."

                – Esteban
                Jul 26 '16 at 21:28












              • Similar project: github.com/rbanffy/pip-chill

                – Ben Creasy
                Jun 23 '17 at 4:32











              • How can you view the reverse tree for all PyPi packages, not only the locally installed packages?

                – Tijme
                Jul 18 '17 at 16:16






              • 1





                pipdeptree is great. Unfortunately it does not appear to take into account dependencies for packages installed by conda: e.g. in a conda env where matplotlib and numpy were installed using pip, but scipy was installed using conda, scipy shows up in the pipdeptree as having no depencies and no dependents (also pip show scipy shows no requirements).

                – djvg
                Sep 27 '18 at 9:01












              • @Dennis I've not tried it but this might work for conda github.com/rvalieris/conda-tree

                – djsutho
                Oct 5 '18 at 2:05













              117












              117








              117







              You could try pipdeptree which displays dependencies as a tree structure e.g.:



              $ pipdeptree
              Lookupy==0.1
              wsgiref==0.1.2
              argparse==1.2.1
              psycopg2==2.5.2
              Flask-Script==0.6.6
              - Flask [installed: 0.10.1]
              - Werkzeug [required: >=0.7, installed: 0.9.4]
              - Jinja2 [required: >=2.4, installed: 2.7.2]
              - MarkupSafe [installed: 0.18]
              - itsdangerous [required: >=0.21, installed: 0.23]
              alembic==0.6.2
              - SQLAlchemy [required: >=0.7.3, installed: 0.9.1]
              - Mako [installed: 0.9.1]
              - MarkupSafe [required: >=0.9.2, installed: 0.18]
              ipython==2.0.0
              slugify==0.0.1
              redis==2.9.1


              To get it run:



              pip install pipdeptree



              EDIT: as noted by @Esteban in the comments you can also list the tree in reverse with -r or for a single package with -p <package_name> so to find what installed Werkzeug you could run:



              $ pipdeptree -r -p Werkzeug
              Werkzeug==0.11.15
              - Flask==0.12 [requires: Werkzeug>=0.7]





              share|improve this answer















              You could try pipdeptree which displays dependencies as a tree structure e.g.:



              $ pipdeptree
              Lookupy==0.1
              wsgiref==0.1.2
              argparse==1.2.1
              psycopg2==2.5.2
              Flask-Script==0.6.6
              - Flask [installed: 0.10.1]
              - Werkzeug [required: >=0.7, installed: 0.9.4]
              - Jinja2 [required: >=2.4, installed: 2.7.2]
              - MarkupSafe [installed: 0.18]
              - itsdangerous [required: >=0.21, installed: 0.23]
              alembic==0.6.2
              - SQLAlchemy [required: >=0.7.3, installed: 0.9.1]
              - Mako [installed: 0.9.1]
              - MarkupSafe [required: >=0.9.2, installed: 0.18]
              ipython==2.0.0
              slugify==0.0.1
              redis==2.9.1


              To get it run:



              pip install pipdeptree



              EDIT: as noted by @Esteban in the comments you can also list the tree in reverse with -r or for a single package with -p <package_name> so to find what installed Werkzeug you could run:



              $ pipdeptree -r -p Werkzeug
              Werkzeug==0.11.15
              - Flask==0.12 [requires: Werkzeug>=0.7]






              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Feb 15 '17 at 5:17

























              answered May 26 '15 at 6:28









              djsuthodjsutho

              2,32411622




              2,32411622







              • 5





                I believe to fully answer @mark 's question you would need to run: pipdeptree -r "Shows the dependency tree in the reverse fashion ie. the sub-dependencies are listed with the list of packages that need them under them."

                – Esteban
                Jul 26 '16 at 21:28












              • Similar project: github.com/rbanffy/pip-chill

                – Ben Creasy
                Jun 23 '17 at 4:32











              • How can you view the reverse tree for all PyPi packages, not only the locally installed packages?

                – Tijme
                Jul 18 '17 at 16:16






              • 1





                pipdeptree is great. Unfortunately it does not appear to take into account dependencies for packages installed by conda: e.g. in a conda env where matplotlib and numpy were installed using pip, but scipy was installed using conda, scipy shows up in the pipdeptree as having no depencies and no dependents (also pip show scipy shows no requirements).

                – djvg
                Sep 27 '18 at 9:01












              • @Dennis I've not tried it but this might work for conda github.com/rvalieris/conda-tree

                – djsutho
                Oct 5 '18 at 2:05












              • 5





                I believe to fully answer @mark 's question you would need to run: pipdeptree -r "Shows the dependency tree in the reverse fashion ie. the sub-dependencies are listed with the list of packages that need them under them."

                – Esteban
                Jul 26 '16 at 21:28












              • Similar project: github.com/rbanffy/pip-chill

                – Ben Creasy
                Jun 23 '17 at 4:32











              • How can you view the reverse tree for all PyPi packages, not only the locally installed packages?

                – Tijme
                Jul 18 '17 at 16:16






              • 1





                pipdeptree is great. Unfortunately it does not appear to take into account dependencies for packages installed by conda: e.g. in a conda env where matplotlib and numpy were installed using pip, but scipy was installed using conda, scipy shows up in the pipdeptree as having no depencies and no dependents (also pip show scipy shows no requirements).

                – djvg
                Sep 27 '18 at 9:01












              • @Dennis I've not tried it but this might work for conda github.com/rvalieris/conda-tree

                – djsutho
                Oct 5 '18 at 2:05







              5




              5





              I believe to fully answer @mark 's question you would need to run: pipdeptree -r "Shows the dependency tree in the reverse fashion ie. the sub-dependencies are listed with the list of packages that need them under them."

              – Esteban
              Jul 26 '16 at 21:28






              I believe to fully answer @mark 's question you would need to run: pipdeptree -r "Shows the dependency tree in the reverse fashion ie. the sub-dependencies are listed with the list of packages that need them under them."

              – Esteban
              Jul 26 '16 at 21:28














              Similar project: github.com/rbanffy/pip-chill

              – Ben Creasy
              Jun 23 '17 at 4:32





              Similar project: github.com/rbanffy/pip-chill

              – Ben Creasy
              Jun 23 '17 at 4:32













              How can you view the reverse tree for all PyPi packages, not only the locally installed packages?

              – Tijme
              Jul 18 '17 at 16:16





              How can you view the reverse tree for all PyPi packages, not only the locally installed packages?

              – Tijme
              Jul 18 '17 at 16:16




              1




              1





              pipdeptree is great. Unfortunately it does not appear to take into account dependencies for packages installed by conda: e.g. in a conda env where matplotlib and numpy were installed using pip, but scipy was installed using conda, scipy shows up in the pipdeptree as having no depencies and no dependents (also pip show scipy shows no requirements).

              – djvg
              Sep 27 '18 at 9:01






              pipdeptree is great. Unfortunately it does not appear to take into account dependencies for packages installed by conda: e.g. in a conda env where matplotlib and numpy were installed using pip, but scipy was installed using conda, scipy shows up in the pipdeptree as having no depencies and no dependents (also pip show scipy shows no requirements).

              – djvg
              Sep 27 '18 at 9:01














              @Dennis I've not tried it but this might work for conda github.com/rvalieris/conda-tree

              – djsutho
              Oct 5 '18 at 2:05





              @Dennis I've not tried it but this might work for conda github.com/rvalieris/conda-tree

              – djsutho
              Oct 5 '18 at 2:05













              64














              The pip show command will show what packages are required for the specified package (note that the specified package must already be installed):



              $ pip show specloud

              Package: specloud
              Version: 0.4.4
              Requires:
              nose
              figleaf
              pinocchio


              pip show was introduced in pip version 1.4rc5






              share|improve this answer




















              • 1





                pip show was introduced in version 1.4rc5, and is present in the (current as of writing) 1.4.1

                – drevicko
                Oct 23 '13 at 2:52






              • 8





                This doesn't answer my question exactly, because it shows the children (dependencies) for a specific package, instead of the parents. But it's easy enough to throw something together to check the dependencies of each package, using this command. So, for example, I could determine which installed package required PyYAML.

                – Mark Chackerian
                Feb 21 '14 at 9:27






              • 4





                As per my previous comment, this shell command dumps out all of the dependencies for each of my installed packages: $ pip freeze | grep -v "-e" | sed s/==.*// | awk 'system("pip show " $1)'

                – Mark Chackerian
                Feb 21 '14 at 15:15











              • An updated version of the script from my previous comment is pip freeze | grep -v "-e" | sed s/==.*// | awk 'system("pip show " $1)' | grep -E '^(Name:|Requires:)' | sed s/Name:/\nName:/ -- but it seems that pipdeptree is now a better solution.

                – Mark Chackerian
                Aug 3 '17 at 15:26















              64














              The pip show command will show what packages are required for the specified package (note that the specified package must already be installed):



              $ pip show specloud

              Package: specloud
              Version: 0.4.4
              Requires:
              nose
              figleaf
              pinocchio


              pip show was introduced in pip version 1.4rc5






              share|improve this answer




















              • 1





                pip show was introduced in version 1.4rc5, and is present in the (current as of writing) 1.4.1

                – drevicko
                Oct 23 '13 at 2:52






              • 8





                This doesn't answer my question exactly, because it shows the children (dependencies) for a specific package, instead of the parents. But it's easy enough to throw something together to check the dependencies of each package, using this command. So, for example, I could determine which installed package required PyYAML.

                – Mark Chackerian
                Feb 21 '14 at 9:27






              • 4





                As per my previous comment, this shell command dumps out all of the dependencies for each of my installed packages: $ pip freeze | grep -v "-e" | sed s/==.*// | awk 'system("pip show " $1)'

                – Mark Chackerian
                Feb 21 '14 at 15:15











              • An updated version of the script from my previous comment is pip freeze | grep -v "-e" | sed s/==.*// | awk 'system("pip show " $1)' | grep -E '^(Name:|Requires:)' | sed s/Name:/\nName:/ -- but it seems that pipdeptree is now a better solution.

                – Mark Chackerian
                Aug 3 '17 at 15:26













              64












              64








              64







              The pip show command will show what packages are required for the specified package (note that the specified package must already be installed):



              $ pip show specloud

              Package: specloud
              Version: 0.4.4
              Requires:
              nose
              figleaf
              pinocchio


              pip show was introduced in pip version 1.4rc5






              share|improve this answer















              The pip show command will show what packages are required for the specified package (note that the specified package must already be installed):



              $ pip show specloud

              Package: specloud
              Version: 0.4.4
              Requires:
              nose
              figleaf
              pinocchio


              pip show was introduced in pip version 1.4rc5







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Oct 9 '16 at 18:58









              Rob Bednark

              10.7k135582




              10.7k135582










              answered Apr 25 '12 at 16:23









              BernardoFireBernardoFire

              4,11942126




              4,11942126







              • 1





                pip show was introduced in version 1.4rc5, and is present in the (current as of writing) 1.4.1

                – drevicko
                Oct 23 '13 at 2:52






              • 8





                This doesn't answer my question exactly, because it shows the children (dependencies) for a specific package, instead of the parents. But it's easy enough to throw something together to check the dependencies of each package, using this command. So, for example, I could determine which installed package required PyYAML.

                – Mark Chackerian
                Feb 21 '14 at 9:27






              • 4





                As per my previous comment, this shell command dumps out all of the dependencies for each of my installed packages: $ pip freeze | grep -v "-e" | sed s/==.*// | awk 'system("pip show " $1)'

                – Mark Chackerian
                Feb 21 '14 at 15:15











              • An updated version of the script from my previous comment is pip freeze | grep -v "-e" | sed s/==.*// | awk 'system("pip show " $1)' | grep -E '^(Name:|Requires:)' | sed s/Name:/\nName:/ -- but it seems that pipdeptree is now a better solution.

                – Mark Chackerian
                Aug 3 '17 at 15:26












              • 1





                pip show was introduced in version 1.4rc5, and is present in the (current as of writing) 1.4.1

                – drevicko
                Oct 23 '13 at 2:52






              • 8





                This doesn't answer my question exactly, because it shows the children (dependencies) for a specific package, instead of the parents. But it's easy enough to throw something together to check the dependencies of each package, using this command. So, for example, I could determine which installed package required PyYAML.

                – Mark Chackerian
                Feb 21 '14 at 9:27






              • 4





                As per my previous comment, this shell command dumps out all of the dependencies for each of my installed packages: $ pip freeze | grep -v "-e" | sed s/==.*// | awk 'system("pip show " $1)'

                – Mark Chackerian
                Feb 21 '14 at 15:15











              • An updated version of the script from my previous comment is pip freeze | grep -v "-e" | sed s/==.*// | awk 'system("pip show " $1)' | grep -E '^(Name:|Requires:)' | sed s/Name:/\nName:/ -- but it seems that pipdeptree is now a better solution.

                – Mark Chackerian
                Aug 3 '17 at 15:26







              1




              1





              pip show was introduced in version 1.4rc5, and is present in the (current as of writing) 1.4.1

              – drevicko
              Oct 23 '13 at 2:52





              pip show was introduced in version 1.4rc5, and is present in the (current as of writing) 1.4.1

              – drevicko
              Oct 23 '13 at 2:52




              8




              8





              This doesn't answer my question exactly, because it shows the children (dependencies) for a specific package, instead of the parents. But it's easy enough to throw something together to check the dependencies of each package, using this command. So, for example, I could determine which installed package required PyYAML.

              – Mark Chackerian
              Feb 21 '14 at 9:27





              This doesn't answer my question exactly, because it shows the children (dependencies) for a specific package, instead of the parents. But it's easy enough to throw something together to check the dependencies of each package, using this command. So, for example, I could determine which installed package required PyYAML.

              – Mark Chackerian
              Feb 21 '14 at 9:27




              4




              4





              As per my previous comment, this shell command dumps out all of the dependencies for each of my installed packages: $ pip freeze | grep -v "-e" | sed s/==.*// | awk 'system("pip show " $1)'

              – Mark Chackerian
              Feb 21 '14 at 15:15





              As per my previous comment, this shell command dumps out all of the dependencies for each of my installed packages: $ pip freeze | grep -v "-e" | sed s/==.*// | awk 'system("pip show " $1)'

              – Mark Chackerian
              Feb 21 '14 at 15:15













              An updated version of the script from my previous comment is pip freeze | grep -v "-e" | sed s/==.*// | awk 'system("pip show " $1)' | grep -E '^(Name:|Requires:)' | sed s/Name:/\nName:/ -- but it seems that pipdeptree is now a better solution.

              – Mark Chackerian
              Aug 3 '17 at 15:26





              An updated version of the script from my previous comment is pip freeze | grep -v "-e" | sed s/==.*// | awk 'system("pip show " $1)' | grep -E '^(Name:|Requires:)' | sed s/Name:/\nName:/ -- but it seems that pipdeptree is now a better solution.

              – Mark Chackerian
              Aug 3 '17 at 15:26











              12














              As I recently said on a hn thread, I'll recommend the following:



              Have a commented requirements.txt file with your main dependencies:



              ## this is needed for whatever reason
              package1


              Install your dependencies: pip install -r requirements.txt.
              Now you get the full list of your dependencies with pip freeze -r requirements.txt:



              ## this is needed for whatever reason
              package1==1.2.3

              ## The following requirements were added by pip --freeze:
              package1-dependency1==1.2.3
              package1-dependency1==1.2.3


              This allows you to keep your file structure with comments, nicely separating your dependencies from the dependencies of your dependencies. This way you'll have a much nicer time the day you need to remove one of them :)



              Note the following:



              • You can have a clean requirements.raw with version control to rebuild your full requirements.txt.

              • Beware of git urls being replaced by egg names in the process.

              • The dependencies of your dependencies are still alphabetically sorted so you don't directly know which one was required by which package but at this point you don't really need it.

              • Use pip install --no-install <package_name> to list specific requirements.

              • Use virtualenv if you don't.





              share|improve this answer




















              • 1





                I just don't understand why this pip freeze -r requirements.txt is not widely used. Very useful for maintaining the dependencies and sub dependencies.

                – Penkey Suresh
                Jul 3 '17 at 8:43











              • minor note: pip install no longer supports --no-install.

                – ryan
                Oct 11 '18 at 16:18















              12














              As I recently said on a hn thread, I'll recommend the following:



              Have a commented requirements.txt file with your main dependencies:



              ## this is needed for whatever reason
              package1


              Install your dependencies: pip install -r requirements.txt.
              Now you get the full list of your dependencies with pip freeze -r requirements.txt:



              ## this is needed for whatever reason
              package1==1.2.3

              ## The following requirements were added by pip --freeze:
              package1-dependency1==1.2.3
              package1-dependency1==1.2.3


              This allows you to keep your file structure with comments, nicely separating your dependencies from the dependencies of your dependencies. This way you'll have a much nicer time the day you need to remove one of them :)



              Note the following:



              • You can have a clean requirements.raw with version control to rebuild your full requirements.txt.

              • Beware of git urls being replaced by egg names in the process.

              • The dependencies of your dependencies are still alphabetically sorted so you don't directly know which one was required by which package but at this point you don't really need it.

              • Use pip install --no-install <package_name> to list specific requirements.

              • Use virtualenv if you don't.





              share|improve this answer




















              • 1





                I just don't understand why this pip freeze -r requirements.txt is not widely used. Very useful for maintaining the dependencies and sub dependencies.

                – Penkey Suresh
                Jul 3 '17 at 8:43











              • minor note: pip install no longer supports --no-install.

                – ryan
                Oct 11 '18 at 16:18













              12












              12








              12







              As I recently said on a hn thread, I'll recommend the following:



              Have a commented requirements.txt file with your main dependencies:



              ## this is needed for whatever reason
              package1


              Install your dependencies: pip install -r requirements.txt.
              Now you get the full list of your dependencies with pip freeze -r requirements.txt:



              ## this is needed for whatever reason
              package1==1.2.3

              ## The following requirements were added by pip --freeze:
              package1-dependency1==1.2.3
              package1-dependency1==1.2.3


              This allows you to keep your file structure with comments, nicely separating your dependencies from the dependencies of your dependencies. This way you'll have a much nicer time the day you need to remove one of them :)



              Note the following:



              • You can have a clean requirements.raw with version control to rebuild your full requirements.txt.

              • Beware of git urls being replaced by egg names in the process.

              • The dependencies of your dependencies are still alphabetically sorted so you don't directly know which one was required by which package but at this point you don't really need it.

              • Use pip install --no-install <package_name> to list specific requirements.

              • Use virtualenv if you don't.





              share|improve this answer















              As I recently said on a hn thread, I'll recommend the following:



              Have a commented requirements.txt file with your main dependencies:



              ## this is needed for whatever reason
              package1


              Install your dependencies: pip install -r requirements.txt.
              Now you get the full list of your dependencies with pip freeze -r requirements.txt:



              ## this is needed for whatever reason
              package1==1.2.3

              ## The following requirements were added by pip --freeze:
              package1-dependency1==1.2.3
              package1-dependency1==1.2.3


              This allows you to keep your file structure with comments, nicely separating your dependencies from the dependencies of your dependencies. This way you'll have a much nicer time the day you need to remove one of them :)



              Note the following:



              • You can have a clean requirements.raw with version control to rebuild your full requirements.txt.

              • Beware of git urls being replaced by egg names in the process.

              • The dependencies of your dependencies are still alphabetically sorted so you don't directly know which one was required by which package but at this point you don't really need it.

              • Use pip install --no-install <package_name> to list specific requirements.

              • Use virtualenv if you don't.






              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Jan 24 '14 at 15:07









              guettli

              4,08125142288




              4,08125142288










              answered Mar 25 '13 at 10:01









              Maxime R.Maxime R.

              5,36043852




              5,36043852







              • 1





                I just don't understand why this pip freeze -r requirements.txt is not widely used. Very useful for maintaining the dependencies and sub dependencies.

                – Penkey Suresh
                Jul 3 '17 at 8:43











              • minor note: pip install no longer supports --no-install.

                – ryan
                Oct 11 '18 at 16:18












              • 1





                I just don't understand why this pip freeze -r requirements.txt is not widely used. Very useful for maintaining the dependencies and sub dependencies.

                – Penkey Suresh
                Jul 3 '17 at 8:43











              • minor note: pip install no longer supports --no-install.

                – ryan
                Oct 11 '18 at 16:18







              1




              1





              I just don't understand why this pip freeze -r requirements.txt is not widely used. Very useful for maintaining the dependencies and sub dependencies.

              – Penkey Suresh
              Jul 3 '17 at 8:43





              I just don't understand why this pip freeze -r requirements.txt is not widely used. Very useful for maintaining the dependencies and sub dependencies.

              – Penkey Suresh
              Jul 3 '17 at 8:43













              minor note: pip install no longer supports --no-install.

              – ryan
              Oct 11 '18 at 16:18





              minor note: pip install no longer supports --no-install.

              – ryan
              Oct 11 '18 at 16:18











              5














              You may also use a one line command which pipes the packages in requirements to pip show.



              cut -d'=' -f1 requirements.txt | xargs pip show





              share|improve this answer


















              • 1





                Generally you can't as the format of requirements.txt is more complex than <package_name>==<package_version>.

                – Piotr Dobrogost
                Mar 25 '16 at 7:33















              5














              You may also use a one line command which pipes the packages in requirements to pip show.



              cut -d'=' -f1 requirements.txt | xargs pip show





              share|improve this answer


















              • 1





                Generally you can't as the format of requirements.txt is more complex than <package_name>==<package_version>.

                – Piotr Dobrogost
                Mar 25 '16 at 7:33













              5












              5








              5







              You may also use a one line command which pipes the packages in requirements to pip show.



              cut -d'=' -f1 requirements.txt | xargs pip show





              share|improve this answer













              You may also use a one line command which pipes the packages in requirements to pip show.



              cut -d'=' -f1 requirements.txt | xargs pip show






              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Apr 23 '15 at 13:23









              biophetikbiophetik

              6613




              6613







              • 1





                Generally you can't as the format of requirements.txt is more complex than <package_name>==<package_version>.

                – Piotr Dobrogost
                Mar 25 '16 at 7:33












              • 1





                Generally you can't as the format of requirements.txt is more complex than <package_name>==<package_version>.

                – Piotr Dobrogost
                Mar 25 '16 at 7:33







              1




              1





              Generally you can't as the format of requirements.txt is more complex than <package_name>==<package_version>.

              – Piotr Dobrogost
              Mar 25 '16 at 7:33





              Generally you can't as the format of requirements.txt is more complex than <package_name>==<package_version>.

              – Piotr Dobrogost
              Mar 25 '16 at 7:33











              3














              First of all pip freeze displays all currently installed packages Python, not necessarily using PIP.



              Secondly Python packages do contain the information about dependent packages as well as required versions. You can see the dependencies of particular pkg using the methods described here. When you're upgrading a package the installer script like PIP will handle the upgrade of dependencies for you.



              To solve updating of packages i recommend using PIP requirements files. You can define what packages and versions you need, and install them at once using pip install.






              share|improve this answer





























                3














                First of all pip freeze displays all currently installed packages Python, not necessarily using PIP.



                Secondly Python packages do contain the information about dependent packages as well as required versions. You can see the dependencies of particular pkg using the methods described here. When you're upgrading a package the installer script like PIP will handle the upgrade of dependencies for you.



                To solve updating of packages i recommend using PIP requirements files. You can define what packages and versions you need, and install them at once using pip install.






                share|improve this answer



























                  3












                  3








                  3







                  First of all pip freeze displays all currently installed packages Python, not necessarily using PIP.



                  Secondly Python packages do contain the information about dependent packages as well as required versions. You can see the dependencies of particular pkg using the methods described here. When you're upgrading a package the installer script like PIP will handle the upgrade of dependencies for you.



                  To solve updating of packages i recommend using PIP requirements files. You can define what packages and versions you need, and install them at once using pip install.






                  share|improve this answer















                  First of all pip freeze displays all currently installed packages Python, not necessarily using PIP.



                  Secondly Python packages do contain the information about dependent packages as well as required versions. You can see the dependencies of particular pkg using the methods described here. When you're upgrading a package the installer script like PIP will handle the upgrade of dependencies for you.



                  To solve updating of packages i recommend using PIP requirements files. You can define what packages and versions you need, and install them at once using pip install.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited May 23 '17 at 12:18









                  Community

                  11




                  11










                  answered Feb 14 '12 at 12:39









                  Mariusz JamroMariusz Jamro

                  20.3k1583119




                  20.3k1583119





















                      1














                      I wrote a quick script to solve this problem. The following script will display the parent (dependant) package(s) for any given package. This way you can be sure it is safe to upgrade or install any particular package. It can be used as follows: dependants.py PACKAGENAME



                      #!/usr/bin/env python3
                      # -*- coding: utf-8 -*-

                      """Find dependants of a Python package"""

                      import logging
                      import pip
                      import pkg_resources
                      import sys

                      __program__ = 'dependants.py'


                      def get_dependants(target_name):
                      for package in pip._internal.utils.misc.get_installed_distributions():
                      for requirement_package in package.requires():
                      requirement_name = requirement_package.project_name
                      if requirement_name == target_name:
                      yield package.project_name


                      # configure logging
                      logging.basicConfig(format='%(levelname)s: %(message)s',
                      level=logging.INFO)

                      try:
                      target_name = sys.argv[1]
                      except IndexError:
                      logging.error('missing package name')
                      sys.exit(1)

                      try:
                      pkg_resources.get_distribution(target_name)
                      except pkg_resources.DistributionNotFound:
                      logging.error("'%s' is not a valid package", target_name)
                      sys.exit(1)

                      print(list(get_dependants(target_name)))





                      share|improve this answer

























                      • This no longer works because the get_installed_distributions() method is no longer available. github.com/pypa/pip/issues/5243

                        – Phil Gyford
                        Mar 7 at 14:55















                      1














                      I wrote a quick script to solve this problem. The following script will display the parent (dependant) package(s) for any given package. This way you can be sure it is safe to upgrade or install any particular package. It can be used as follows: dependants.py PACKAGENAME



                      #!/usr/bin/env python3
                      # -*- coding: utf-8 -*-

                      """Find dependants of a Python package"""

                      import logging
                      import pip
                      import pkg_resources
                      import sys

                      __program__ = 'dependants.py'


                      def get_dependants(target_name):
                      for package in pip._internal.utils.misc.get_installed_distributions():
                      for requirement_package in package.requires():
                      requirement_name = requirement_package.project_name
                      if requirement_name == target_name:
                      yield package.project_name


                      # configure logging
                      logging.basicConfig(format='%(levelname)s: %(message)s',
                      level=logging.INFO)

                      try:
                      target_name = sys.argv[1]
                      except IndexError:
                      logging.error('missing package name')
                      sys.exit(1)

                      try:
                      pkg_resources.get_distribution(target_name)
                      except pkg_resources.DistributionNotFound:
                      logging.error("'%s' is not a valid package", target_name)
                      sys.exit(1)

                      print(list(get_dependants(target_name)))





                      share|improve this answer

























                      • This no longer works because the get_installed_distributions() method is no longer available. github.com/pypa/pip/issues/5243

                        – Phil Gyford
                        Mar 7 at 14:55













                      1












                      1








                      1







                      I wrote a quick script to solve this problem. The following script will display the parent (dependant) package(s) for any given package. This way you can be sure it is safe to upgrade or install any particular package. It can be used as follows: dependants.py PACKAGENAME



                      #!/usr/bin/env python3
                      # -*- coding: utf-8 -*-

                      """Find dependants of a Python package"""

                      import logging
                      import pip
                      import pkg_resources
                      import sys

                      __program__ = 'dependants.py'


                      def get_dependants(target_name):
                      for package in pip._internal.utils.misc.get_installed_distributions():
                      for requirement_package in package.requires():
                      requirement_name = requirement_package.project_name
                      if requirement_name == target_name:
                      yield package.project_name


                      # configure logging
                      logging.basicConfig(format='%(levelname)s: %(message)s',
                      level=logging.INFO)

                      try:
                      target_name = sys.argv[1]
                      except IndexError:
                      logging.error('missing package name')
                      sys.exit(1)

                      try:
                      pkg_resources.get_distribution(target_name)
                      except pkg_resources.DistributionNotFound:
                      logging.error("'%s' is not a valid package", target_name)
                      sys.exit(1)

                      print(list(get_dependants(target_name)))





                      share|improve this answer















                      I wrote a quick script to solve this problem. The following script will display the parent (dependant) package(s) for any given package. This way you can be sure it is safe to upgrade or install any particular package. It can be used as follows: dependants.py PACKAGENAME



                      #!/usr/bin/env python3
                      # -*- coding: utf-8 -*-

                      """Find dependants of a Python package"""

                      import logging
                      import pip
                      import pkg_resources
                      import sys

                      __program__ = 'dependants.py'


                      def get_dependants(target_name):
                      for package in pip._internal.utils.misc.get_installed_distributions():
                      for requirement_package in package.requires():
                      requirement_name = requirement_package.project_name
                      if requirement_name == target_name:
                      yield package.project_name


                      # configure logging
                      logging.basicConfig(format='%(levelname)s: %(message)s',
                      level=logging.INFO)

                      try:
                      target_name = sys.argv[1]
                      except IndexError:
                      logging.error('missing package name')
                      sys.exit(1)

                      try:
                      pkg_resources.get_distribution(target_name)
                      except pkg_resources.DistributionNotFound:
                      logging.error("'%s' is not a valid package", target_name)
                      sys.exit(1)

                      print(list(get_dependants(target_name)))






                      share|improve this answer














                      share|improve this answer



                      share|improve this answer








                      edited Mar 8 at 22:28

























                      answered Oct 17 '15 at 11:58









                      SixSix

                      2,0341426




                      2,0341426












                      • This no longer works because the get_installed_distributions() method is no longer available. github.com/pypa/pip/issues/5243

                        – Phil Gyford
                        Mar 7 at 14:55

















                      • This no longer works because the get_installed_distributions() method is no longer available. github.com/pypa/pip/issues/5243

                        – Phil Gyford
                        Mar 7 at 14:55
















                      This no longer works because the get_installed_distributions() method is no longer available. github.com/pypa/pip/issues/5243

                      – Phil Gyford
                      Mar 7 at 14:55





                      This no longer works because the get_installed_distributions() method is no longer available. github.com/pypa/pip/issues/5243

                      – Phil Gyford
                      Mar 7 at 14:55











                      0














                      (workaround, not true answer)



                      Had the same problem, with lxml not installing and me wanting to know who needed lxml. Not who lxml needed. Ended up bypassing the issue by.



                      1. noting where my site packages were being put.


                      2. go there and recursive grep for the import (the last grep's --invert-match serves to remove lxml's own files from consideration).


                      Yes, not an answer as to how to use pip to do it, but I didn't get any success out of the suggestions here, for whatever reason.



                       site-packages me$ egrep -i --include=*.py -r -n lxml . | grep import | grep --invert-match /lxml/





                      share|improve this answer



























                        0














                        (workaround, not true answer)



                        Had the same problem, with lxml not installing and me wanting to know who needed lxml. Not who lxml needed. Ended up bypassing the issue by.



                        1. noting where my site packages were being put.


                        2. go there and recursive grep for the import (the last grep's --invert-match serves to remove lxml's own files from consideration).


                        Yes, not an answer as to how to use pip to do it, but I didn't get any success out of the suggestions here, for whatever reason.



                         site-packages me$ egrep -i --include=*.py -r -n lxml . | grep import | grep --invert-match /lxml/





                        share|improve this answer

























                          0












                          0








                          0







                          (workaround, not true answer)



                          Had the same problem, with lxml not installing and me wanting to know who needed lxml. Not who lxml needed. Ended up bypassing the issue by.



                          1. noting where my site packages were being put.


                          2. go there and recursive grep for the import (the last grep's --invert-match serves to remove lxml's own files from consideration).


                          Yes, not an answer as to how to use pip to do it, but I didn't get any success out of the suggestions here, for whatever reason.



                           site-packages me$ egrep -i --include=*.py -r -n lxml . | grep import | grep --invert-match /lxml/





                          share|improve this answer













                          (workaround, not true answer)



                          Had the same problem, with lxml not installing and me wanting to know who needed lxml. Not who lxml needed. Ended up bypassing the issue by.



                          1. noting where my site packages were being put.


                          2. go there and recursive grep for the import (the last grep's --invert-match serves to remove lxml's own files from consideration).


                          Yes, not an answer as to how to use pip to do it, but I didn't get any success out of the suggestions here, for whatever reason.



                           site-packages me$ egrep -i --include=*.py -r -n lxml . | grep import | grep --invert-match /lxml/






                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered May 18 '15 at 16:40









                          JL PeyretJL Peyret

                          3,1371731




                          3,1371731



























                              draft saved

                              draft discarded
















































                              Thanks for contributing an answer to Stack Overflow!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid


                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.

                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f9232568%2fidentifying-the-dependency-relationship-for-python-packages-installed-with-pip%23new-answer', 'question_page');

                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

                              2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived

                              Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme