Is there any way to show the dependency trees for pip packages?

You should take a look at pipdeptree: $ pip install pipdeptree $ pipdeptree -fl Warning!!! Cyclic dependencies found: ———————————————————————— xlwt==0.7.5 ruamel.ext.rtf==0.1.1 xlrd==0.9.3 openpyxl==2.0.4 – jdcal==1.0 pymongo==2.7.1 reportlab==3.1.8 – Pillow==2.5.1 – pip – setuptools It doesn’t generate a requirements.txt file as you indicated directly. However the source (255 lines of python code) should be relatively easy … Read more

How to customize a requirements.txt for multiple environments?

You can cascade your requirements files and use the “-r” flag to tell pip to include the contents of one file inside another. You can break out your requirements into a modular folder hierarchy like this: `– django_project_root |– requirements | |– common.txt | |– dev.txt | `– prod.txt `– requirements.txt The files’ contents would … Read more

requirements.txt vs setup.py

requirements.txt: This helps you to set up your development environment. Programs like pip can be used to install all packages listed in the file in one fell swoop. After that you can start developing your python script. Especially useful if you plan to have others contribute to the development or use virtual environments. This is … Read more

Upgrade python packages from requirements.txt using pip command

I already answered this question here. Here’s my solution: Because there was no easy way for upgrading package by package, and updating the requirements.txt file, I wrote this pip-upgrader which also updates the versions in your requirements.txt file for the packages chosen (or all packages). Installation pip install pip-upgrader Usage Activate your virtualenv (important, because … Read more

In requirements.txt, what does tilde equals (~=) mean?

It means it will select the latest version of the package, greater than or equal to 0.6.10, but still in the 0.6.* version, so it won’t download 0.7.0 for example. It ensures you will get security fixes but keep backward-compatibility, if the package maintainer respects the semantic versioning (which states that breaking changes should occur … Read more

Reference requirements.txt for the install_requires kwarg in setuptools setup.py file

On the face of it, it does seem that requirements.txt and setup.py are silly duplicates, but it’s important to understand that while the form is similar, the intended function is very different. The goal of a package author, when specifying dependencies, is to say “wherever you install this package, these are the other packages you … Read more

How to state in requirements.txt a direct github source

Normally your requirements.txt file would look something like this: package-one==1.9.4 package-two==3.7.1 package-three==1.0.1 … To specify a Github repo, you do not need the package-name== convention. The examples below update package-two using a GitHub repo. The text between @ and # denotes the specifics of the package. Specify commit hash (41b95ec in the context of updated … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)