4

I'm trying to use Docker to create a dependency package for AWS Lambda using this repository, but whenever I try to run the build.sh file, I end up with the message:

no such option: --use-wheel

Then when I try to use pip install wheel (outside of Docker), I'm told that it's already on my local machine, which it is. How do I install Wheel in the Docker container?

If it's helpful, this appears to be the line of code in build.sh that is giving the issue:

test -f /outputs/requirements.txt && pip install --use-wheel -r /outputs/requirements.txt

Any help is much appreciated!

Spencer Goff
  • 1,036
  • 3
  • 14
  • 23

2 Answers2

12

Your issue isn't due to missing dependencies ( wheel is installed in the build.sh script you referenced: https://github.com/ryansb/sklearn-build-lambda/blob/master/build.sh#L18 )

use-wheel was deprecated and no longer exists for pip.

You can achieve the same by omitting the --use-wheel entries from the script. Take a look at the Python 3.6 PR on the linked repository: https://github.com/ryansb/sklearn-build-lambda/pull/16/files#diff-0b83f9dedf40d7356e5ca147a077acb4

mbeacom
  • 1,466
  • 15
  • 25
  • Okay, I tried replacing the original build.sh with the pull request that you linked to, but now I get the error `pkg_resources.DistributionNotFound: The 'pip==9.0.1' distribution was not found and is required by the application` and I'm not sure how to update pip within Docker, assuming that's what I need to do? I'll also try just omitting the commands from the original build.sh and see if that helps. – Spencer Goff Apr 14 '18 at 20:48
  • It's working now. I simply deleted all instances of '--use-wheel', as you recommended. Thanks! – Spencer Goff Apr 14 '18 at 22:33
5

--use-wheel is deprecated since pip 7 (in favor of --only-binary) and removed since pip 10 beta 1.

To fix all scripts in a git repo:

git grep -l -- --use-wheel | while read f; do sed -i -e 's|use-wheel|only-binary=:all:|g' ${f}; done

simleo
  • 2,775
  • 22
  • 23