Reputation: 129
I have a whl file for a custom package (not published open source) in a S3 bucket.
I now want to import/install it in my sagemaker instance. https://medium.com/@shadidc/installing-custom-python-package-to-sagemaker-notebook-b7b897f4f655 This link is what I tried to follow, but it did not work for me.
Has anyone tried this before?
Upvotes: 4
Views: 1717
Reputation: 348
Using AWS Sagemaker Jupyter cell
Quick and dirty, upload the whl file in same workspace as of notebook and just install.
%pip install custom_package_name.whl
Now, you would need to restart the kernel and then import. You should be able to work through.
Another simple approach is to get the whl file from S3 folder and install.
s3 = boto3.client("s3")
s3_bucket = "your core s3 bucket location"
file_location = "your file location and file name with extension"
Below I'm using same file location for both source and target
s3_client.download_file(s3_bucket, file_location, file_location)
%pip install ./your_target_folder_name/custom_package.whl
Now, you would need to restart the kernel and then import. You should be able to work through.
Upvotes: 2