I'm trying to use a spaCy model within an IBM Cloud deployed function and the installation of spacy fails without a specific error.
How to reproduce:
def dummy_deployable_function():
try:
import subprocess
subprocess.check_output("pip install spacy --user", stderr=subprocess.STDOUT, shell=True)
except subprocess.CalledProcessError as e:
install_err = "subprocess.CalledProcessError:\n\n" + "cmd:\n" + e.cmd + "\n\noutput:\n" + e.output.decode()
raise Exception( "Installing failed:\n" + install_err )
import spacy
def score(payload):
return payload["values"][0]
return score
from watson_machine_learning_client import WatsonMachineLearningAPIClient
wml_credentials = { # not shown :-)
"apikey": "",
"instance_id": "",
"password": "",
"url": "",
"username": ""
}
client = WatsonMachineLearningAPIClient( wml_credentials )
# Store the function
meta_data = { client.repository.FunctionMetaNames.NAME : 'Dummy Model' }
function_details = client.repository.store_function( meta_props=meta_data, function=dummy_deployable_function )
function_id = function_details["metadata"]["guid"]
function_deployment_details = client.deployments.create( artifact_uid=function_id, name='Dummy Model Deployment')
The last line of the 'error' I'm receiving is just:
Installing collected packages: srsly, attrs, pyrsistent, jsonschema, wasabi, cymem, preshed, murmurhash, plac, blis, thinc, spacy
The exit code of pip is -9.
Any ideas (or alternative solutions) on how this problem can be solved? A lot of other packages (including all spacy dependencies) can be installed. Thanks for your help.