-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow pip to install libraries in a directory. #446
Comments
I think this is already almost-possible two different ways, via Just making -d extract the tarballs or --no-install move them will not work; there's much more that happens in a proper installation of a Python package than just unpacking a tarball. In many cases it amounts to little more than copying a directory, but not in all cases. There are often things included in a tarball that aren't actually installed, and some packages do additional manipulations to the installed files. I might not be opposed to a pull request for something like a |
Fantastic, I've already started work on this. Adding the extra options and aliasing to the required commands was trivial, and already works properly. However, is the assumption that I can just move all directories in "path/lib/python/" that don't end in ".egg-info" out to "path/" sound? I am not entirely certain how pip installs packages, so I thought I should ask before assuming things that might not be correct. |
@skorokithakis I'd actually recommend just moving everything, including the .egg-info directories. Those directories provide metadata about what's installed; their presence won't hurt anything, and there's no reason to remove that metadata. |
Great, I'll send you the pull request in a few minutes, then, thank you. My reason for removing those directories is just because of added clutter (one usually works with all the libraries installed in the working directory in GAE, for example, so those would clutter things up too much). You are correct, though, it's trivial to just remove those if you don't need them. |
Well, everything is almost ready, except for one problem: What about libraries that already exist? Currently, I'm using a temporary directory (from mkdtemp) to install everything in (as an argument to --home) and then I move everything to the target dir. Is the reasonable behaviour to replace anything that might already exist? If so, I'll push now. |
I have sent a push request for review, let me know if something is wrong. Overwriting existing files sounds reasonable, at least. |
Yes, I think overwriting existing files makes sense. In the typical use case for this, the target directory would be under version control anyway, and overwriting could be useful for upgrades. |
Fixed with merge of #447 |
The -t option seems to break other options used with pip install. 1). with --upgrade -r requirements.txt 2). with -e [email protected]:.../foo.git#egg=foo |
As useful as it is, |
I get the following error when trying to use
|
Fits our use-case, please don't remove it! |
Did you ever get to fix the incompatibility between --target and --editable options, as reported by @richburdon? |
Some environments, like AppEngine, require packages to be in a specific directory. Right now, I haven't found a way to automatically download and install these. It would be fantastic if pip could download the packages and extract them into a directory specified by the user, similar to --no-install or -d, except it wouldn't just download tarballs or place them in the "build" directory, it would place them in a directory the user specified.
This could be as easy as making -d extract the tarballs or --no-install move them to a directory.
For example:
This is different from --no-install, which extracts the package in "build/" ("download" would place the module at the directory, not the entire contents of the package, the setup.py files, etc), and different from -d, which just downloads the package.
The text was updated successfully, but these errors were encountered: