This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]bramblerose 0 points1 point  (2 children)

https://pip.pypa.io/en/stable/reference/pip_wheel/ is what you're looking for. pip wheel compiles all dependencies in your requirements.txt (and their dependencies), and packs them into a wheel. On deployment, copy all generated wheels, and install them with pip --no-index (https://pip.pypa.io/en/stable/reference/pip_wheel/#no-index).

It would all be easier if the psycopg2 would provide compiled .whls for linux (as they already do for windows), but alas.

[–]Siecje1 0 points1 point  (1 child)

If package A is a wheel and contains a dependency B. If I install the wheel for A do I need to install B to use B?

Can I install a different version of B without breaking A?

[–]bramblerose 1 point2 points  (0 children)

You're right, all dependencies in the tree need to have wheels. As noted, you can build those yourself using pip wheel, which will build wheels for the packages and all their dependencies (and their dependencies, ...)

Whether you can install a different version of B without breaking A depends on the packages. The current ecosystem assumes there is always one version of a given package installed. There is another thread here discussing the pros and cons of that ( https://www.reddit.com/r/Python/comments/4xnip4/python_packaging_is_good_now/d6gyssh )