pipdeptree | command line utility to display dependency tree | Build Tool library
kandi X-RAY | pipdeptree Summary
kandi X-RAY | pipdeptree Summary
A command line utility to display dependency tree of the installed Python packages
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Returns the command line parser for the installed python packages .
- Filter out this distribution based on the given include and exclude filters .
- Dumps the given tree into a digraph graph .
- Main entry point .
- Generate a JSON representation of the given tree .
- Renders the tree .
- Executes non - executing python command .
- Create a frozen RequireRequire from a piped distribution .
- Attempts to guess the version from a package .
- Reverse the DAG .
pipdeptree Key Features
pipdeptree Examples and Code Snippets
# Let's find what's our UID
$ id -u $USER
1001
# If it's 1001:
docker-compose build --build-arg DJANGO_USER_UID=1001
make build
# For run attached
make run
# Run detached
make rund
# Using our shortcut
make enter
# Or with docker-compose
docker-co
# From inside your Python environment:
$ python -m pip install pipdeptree
# We only care about packages requiring urllib3
$ pipdeptree --reverse | grep "requires: urllib3"
$ mv requirements.txt requirements.in
$ docker run -it thatcontainerimage /var/app/bin/pip freeze -l > requirements.txt
google-cloud-bigquery==1.22.0
- google-cloud-core [required: >=1.0.3,<2.0dev, installed: 1.6.0]
Warning!!! Possibly conflicting dependencies found:
* pylint==2.7.4
- astroid [required: >=2.5.2,<2.7,
conda create -n kaggle_xgboost_test python=3.8 pandas numpy scikit-learn xgboost jupyter
conda activate kaggle_xgboost_test
# Then open a notebook
jupyter-notebook
# And try to import xgboost with e.g.
import xgboost
print("imported ok")
$ johnnydep --verbose 0 'graphene==2.1.0'
name summary
------------------------------ ---------------------------------------
graphene==2.1.0 GraphQL Framework for Python
├── aniso8601<4,>=
pipdeptree -l | grep -i '^[[:alnum:]]' > requirements.txt
pipdeptree
pipdeptree --freeze --warn silence | grep -P '^[\w0-9\-=.]+'
# version
$ conda-tree --version
conda-tree 0.0.4
# packages that no other package depends on
$ conda-tree leaves
[
pip install johnnydep
johnnydep your-wheel-file.whl --output-format=pinned
$ johnnydep johnnydep-0.5-py2.py3-none-any.whl --output-format pinned
johnnydep==0.5
anytree==2.4.3
cachetools==2.1.0
colorama==0.3.9
oyaml
--json-tree Display dependency tree as json which is nested the
same way as the plain text output printed by default.
This option overrides all other options (except
--json).
Community Discussions
Trending Discussions on pipdeptree
QUESTION
I'm getting version clashes when I try to build a dockerfile. This doesn't happen when I run pip install -r requirements.txt in a local venv. I ran pipdeptree in my local venv after installing and found no clashes. This is only occuring when I try to build with docker through the eb cli.
I'm running docker-ce 19.03.9. Both my local venv and my dockerfile are configured to run Python 3.6. I've been unable to contact the original developer and I'm not that familiar with docker so I'm not sure where to go from here other than installing different versions of docker and trying again.
As requested, here is the dockefile;
...ANSWER
Answered 2021-Sep-27 at 12:09The instructions Pip helpfully links you to explain what's going on, and it is indeed a bit of a hairy situation.
There is already an Beanstalk application that's running EC2s with docker containers that work just fine with these requirements so I'm not sure why this is happening now.
As to "why this is happening now" – two things I can think of:
- The Pip version in your base image has been updated; newer versions are smarter about conflicting dependencies (in that they refuse to install package constellations that might/should not work).
- Because your requirements.txt isn't necessarily fully locked down; there are transitive dependencies that get installed that aren't listed in the file that have become incompatible with one another.
However, since you already do have working container images, that's great! You could simply do
QUESTION
We are using conda to maintain a python environment and I'd like to understand why google-cloud-bigquery==1.22.0 is being installed when the latest available version is https://pypi.org/project/google-cloud-bigquery/2.16.1/ and the latest vaailable version on conda-forge (https://anaconda.org/conda-forge/google-cloud-bigquery) is 2.15.0
Here's a Dockerfile that builds our conda environment:
...ANSWER
Answered 2021-May-14 at 10:19To answer your last question first:
QUESTION
I am using Python 3.9.0 and Spyder 4.2.0 on Windows 10 (x64) machine. Via official repo, I installed the spyder-terminal
plugin using pip
. It installed successfully. After installation, when I open the Spyder IDE, I can't see the terminal. I tried digging into View>Panes
and also under Preferences
, but couldn't see any hints towards enabling/checking the spyder-terminal?
Did someone come across the same issue and has a workaround to suggest? Am I missing some dependencies?
Here is the output of pip list
:
ANSWER
Answered 2020-Dec-20 at 20:18Click on View => Pane => IPython Console. Ipython console should open up at the bottom right corner
QUESTION
I am using pip-tools 5.4.0, pip 20.3.1, and python3. I have looked at pip-tools source code and the pip blog post about the new resolver. I do not see an explicit answer to my question. If I run:
...ANSWER
Answered 2020-Dec-06 at 20:46To the best of my knowledge (which is several years of using pip-tools), pip-tools will always give you a stable tree so long as you do then install dependencies only from the "locked" requirements file.
QUESTION
ANSWER
Answered 2020-Nov-09 at 22:58If you create a new conda environment do you get the same error? E.g.
QUESTION
I am aware that pip freeze > requirements.txt
exists, yet that that prints out my system packages, of which only a few my directory/ project needs.
I am not using a virtualenv
so I'm pretty sure I can't print out local packages like that.
I also know that pipdeptree
exsists but I also don't see how that solves my problem?
ANSWER
Answered 2020-Aug-15 at 08:24I believe tools like the following could help:
As far as I can tell, these tools read the code in the directory and try to figure out the dependencies required based on the import statements they found in the code.
Related:
QUESTION
Is there an easy way to determine for a Python package, by which other—not installed—packages it is used?
For instance when I found an interesting package and want to know whether another project using it might save me from reinventing the wheel, for what I actually want to implement.
So like pipdeptree --reverse
(see this answer) extended to packages that I do not have installed, but are known on github.com or pypi.org.
ANSWER
Answered 2020-Aug-08 at 08:52Incidentially saw on github the Used by link (right sidebar), which is a short-cut to https://github.com/.../network/dependents/ (also via Insights).
QUESTION
I'm trying to see all the dependencies that are required for an specific package(in this case I'm using pipdeptree) but it turns out that it only shows me the dependency tree for an installed package. Let's say that I'm using graphene:2.1.0, so e.g:
...ANSWER
Answered 2020-May-07 at 14:24I believe johnnydep can help with that:
QUESTION
I am using pip 20.0.2 on Ubuntu, and installing a bunch of requirements from a requirements file. For some reason, pip is deciding to install idna==2.9
(link), even though that is not a compatible version with one of my directly listed dependencies. So I used python -m pipdeptree -r
within the virtualenv that I'm installing everything to, and I see this listed for idna
:
ANSWER
Answered 2020-Feb-19 at 16:57Pip does not have a dependency resolver. If you tell it to install package foo
without any qualifications, you’re getting the newest version of foo
, even if it conflicts with other packages you’ve already installed.
Other solutions like poetry exist which do have the logic to keep everything compatible. If you need this, consider using something like that instead of plain pip.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install pipdeptree
You can use pipdeptree like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page