3

Here's a very simple requirements.txt:

numpy
sharedmem

The problem is, sharedmem actually depends on having numpy available to even run its setup.py, it's an install dependency. Running pip install -r requirements.txt does try to install numpy first, as expected, but sharedmem still breaks on trying to import numpy.distutils.core. Presumably because pip installs libraries into a temporary build directory first and it's not in the import path.

Any ideas on how to deal with it?

P.S. Looks like this is a dupe: In Python, `pip -r requirements.txt` doesn't install packages *recursively*?, but the problem wasn't resolved there either.

Community
  • 1
  • 1
isagalaev
  • 1,173
  • 11
  • 16
  • That kind of looks like the fault of `sharedmem`'s `setup.py` to me. We should not import dependencies since they may not be there yet, causing exactly the breakage you are seeing .. – wim Aug 08 '16 at 18:58
  • Yes, sharedmem happens to not actually need those imports (as far as I see), but the problem is more general: there are packages that depend on others for setup.py to run, it's a legitimate requirement. – isagalaev Aug 08 '16 at 19:08
  • Oh, it actually does use numpy's specific version of `setup()`. But I don't know if it actually needs it. – isagalaev Aug 08 '16 at 19:20
  • Same happens with cloudflare-1.1.5. They use "requests" in setup, and it doesn't work in a single "install -r requirements", even though "requests" is in requirements of cloudflare, and even specified explicitly in requirements.txt before cloudflare. Workaround is to setup dependency by a separate install cmd :( – Max Lobur Oct 05 '16 at 12:44

0 Answers0