We're developing an AWS Lambda function for Alexa skill in Python and using pip
to install the ask-sdk
package to our dist/
directory:
pip install -t dist/ ask-sdk
The trouble is with the -t dist/
because pip
wants to have all the dependencies there, even if they are installed system-wide.
Now, ask-sdk
has a dependency on boto3
which pulls in a whole lot of other packages. However the AWS Lambda runtime environment provides boto3
and there is no need to package that and its dependencies with our code. I do have boto3
installed in the system and import boto3
works, so I thought pip
should be happy, but because of -t dist/
it always installs it.
Can I somehow install just ask-sdk
and its dependencies that don't exist in the system, e.g. ask-sdk-core
, but not those that are already installed?
One way is to list all the modules and use pip --no-deps
but that means a constantly keeping track of the dependencies manually, we would like to avoid that.
Somehow I would like to tell pip
: if the package is already installed, even if not in -t dist/
don't put a copy in dist/
.
Is that possible?
Thanks!