安装watson-machine-learning-client时出错

时间:2019-02-13 12:44:54

标签: python pip ibm-watson

使用命令 pip install watson-machine-learning-client

终端抛出错误,这是终端的输出:

pip install watson-machine-learning-client
Collecting watson-machine-learning-client
  Using cached https://files.pythonhosted.org/packages/7a/ea/75de2fe2373cb3d2f0c7342b35956c4df62fce5a312cfd652a339bfb97a0/watson_machine_learning_client-1.0.357.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/l0/8fv181bn3nb6fdrnyk87j7qc0000gn/T/pip-install-oRyoix/watson-machine-learning-client/setup.py", line 30, in <module>
        with open(os.path.join(this_directory, 'README.md'), encoding='utf-8') as f:
    TypeError: 'encoding' is an invalid keyword argument for this function

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/l0/8fv181bn3nb6fdrnyk87j7qc0000gn/T/pip-install-oRyoix/watson-machine-learning-client/

enter image description here

1 个答案:

答案 0 :(得分:2)

您正在使用python 2安装该软件包,该软件包在PyPi上被错误地列为支持python 2。如您在official homepage(“需求”部分)所见:

  

Watson Machine Learning服务实例,您可以使用此链接创建实例。仅支持Python 3.5或更高版本。

您可以尝试将代码反向移植到python 2,但我建议在此处使用pyhton 3。