在Watson Machine Learning部署的功能中安装spacy失败而没有错误消息

时间:2019-07-10 15:35:45

标签: python ibm-watson spacy watson-studio

我正在尝试在IBM Cloud部署的功能中使用spaCy模型,并且spacy的安装失败,没有特定的错误。

如何复制:

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')

我收到的“错误”的最后一行就是:

  

安装收集的软件包:srsly,attrs,pyrsistent,jsonschema,wasabi,cymem,preshed,murmurhash,plac,blis,thinc,spacy

pip的退出代码为-9。

关于如何解决此问题的任何想法(或替代解决方案)?可以安装许多其他软件包(包括所有spacy依赖项)。感谢您的帮助。

1 个答案:

答案 0 :(得分:0)

您应该尝试的一件事是首先使用insert into summary(transdate,particulars,amount_cr) select month,description,sum(amount) from petty_cash_logs group by month,description 安装依赖项,然后再安装SpaCy。

所以首先去 ID FIRST_NAME LAST_NAME COLUMN_NM_TOO_LON5THCOLUMN 10000000001MINNIE MOUSE COLUMN VALUE LONGSTARTS $infile = "C:\Testing\IN_AND_OUT_FILES\srctst.txt" $outfile = "C:\Testing\IN_AND_OUT_FILES\outtst.txt" $batch = 1 [regex]$match_regex = '^(.{10})(.{50})(.{50})(.{50})(.{50})(.{3})(.{8})(.{4})(.{50})(.{2})(.{30})(.{6})(.{3})(.{4})(.{25})(.{2})(.{10})(.{3})(.{8})(.{4})(.{50})(.{2})(.{30})(.{6})(.{3})(.{2})(.{25})(.{2})(.{10})(.{3})(.{10})(.{10})(.{10})(.{2})(.{10})(.{50})(.{50})(.{50})(.{50})(.{8})(.{4})(.{50})(.{2})(.{30})(.{6})(.{3})(.{2})(.{25})(.{2})(.{10})(.{3})(.{4})(.{2})(.{4})(.{10})(.{38})(.{38})(.{15})(.{1})(.{10})(.{2})(.{10})(.{10})(.{10})(.{10})(.{38})(.{38})(.{10})(.{10})(.{10})(.{10})(.{10})(.{10})(.{10})(.{10})(.{10})(.{10})(.{10})(.{10})(.{10})(.{10})(.{10})(.{10})(.{10})(.{10})(.{10})(.{10})(.{10})(.{10})(.{10})(.{10})(.{10})$' [regex]$replace_regex = "`${1}`t`${2}`t`${3}`t`${4}`t`${5}`t`${6}`t`${7}`t`${8}`t`${9}`t`${10}`t`${11}`t`${12}`t`${13}`t`${14}`t`${15}`t`${16}`t`${17}`t`${18}`t`${19}`t`${20}`t`${21}`t`${22}`t`${23}`t`${24}`t`${25}`t`${26}`t`${27}`t`${28}`t`${29}`t`${30}`t`${31}`t`${32}`t`${33}" Get-Content $infile -ReadCount $batch | foreach { $_ -replace $match_regex, $replace_regex | Out-File $outfile -Append }