How to have `pip install --editable` to run sdist instead of develop?

By : phretor

This points out a very interesting features of pip.

However, sometimes you just want it to install the source distribution; this is particularly true when

  • you are running in a virtualenv (so you don't care about messing up the python path, since you are deliberating doing it in an env),
  • when you are not the developer of that particular package, and you don't want to have it "editable",
  • when you cannot pip install package-name because the package is not in any index,
  • when there is no tar.gz available.

Thanks for your answers!

By : phretor


Have you tried just omitting the --editable? If I run

pip install hg

it clones the repo to a temporary build directory and installs normally (via install rather than develop).

Of course, if you then freeze this environment, the generated requirement will not be fulfillable. If you need this, then just use --editable (there's really not much difference, works fine even if you don't actually need to edit the package) or just run your own instance of something like chishop and upload the sdists you need to it, then use the -i or --extra-index-url option.

This video can help you solving your question :)
By: admin