Message257903
The idea is to add a method to pip that tries to import a package and if the import fails then try to download and install the package handling the UI.
Yes, you can put the package as a dependency in your pip config for
your code. This is intended for the case when you have a bunch of
python tools/libs in some shared repository in your organization.
People check the code out and expect it to run but it has third party
dependencies. There is no install step for your code, per se. Furthermore the people using your code don't know enough about python to install things themselves.
Proposed syntax is:
import pip
pip.require("foo")
If you search online for pip.main you'll see a whole bunch of hall-baked brittle solutions to this problem that look like this:
try:
import foo
except ImportError:
pip.main("install", "foo") |
|
Date |
User |
Action |
Args |
2016-01-10 10:52:00 | Blaize Rhodes | set | recipients:
+ Blaize Rhodes |
2016-01-10 10:52:00 | Blaize Rhodes | set | messageid: <1452423120.4.0.471254538905.issue26074@psf.upfronthosting.co.za> |
2016-01-10 10:51:59 | Blaize Rhodes | link | issue26074 messages |
2016-01-10 10:51:59 | Blaize Rhodes | create | |
|