【问题标题】:Watson Developer Cloud showing error: Microsoft Visual C++ 14.0 is requiredWatson Developer Cloud 显示错误:需要 Microsoft Visual C++ 14.0
【发布时间】:2018-04-04 10:28:18
【问题描述】:

我正在尝试使用 Python 进行 Watson 视觉识别,如下:https://www.ibm.com/watson/developercloud/visual-recognition/api/v3/python.html?python#introduction

尝试安装库时:

pip install --upgrade "watson-developer-cloud>=1.2.1"

即使在安装“Microsoft Visual C++ 14.0”后,我仍然收到以下错误,我也卸载了其他版本的 MSVC++。

Collecting watson-developer-cloud>=1.2.1
  Using cached watson-developer-cloud-1.2.1.tar.gz
Requirement already up-to-date: requests<3.0,>=2.0 in c:\python36\lib\site-packages (from watson-developer-cloud>=1.2.1)
Requirement already up-to-date: python_dateutil>=2.5.3 in c:\python36\lib\site-packages (from watson-developer-cloud>=1.2.1)
Requirement already up-to-date: autobahn>=0.10.9 in c:\python36\lib\site-packages (from watson-developer-cloud>=1.2.1)
Collecting Twisted>=13.2.0 (from watson-developer-cloud>=1.2.1)
  Using cached Twisted-17.9.0.tar.bz2
Collecting pyOpenSSL>=16.2.0 (from watson-developer-cloud>=1.2.1)
  Using cached pyOpenSSL-17.5.0-py2.py3-none-any.whl
Collecting service-identity>=17.0.0 (from watson-developer-cloud>=1.2.1)
  Using cached service_identity-17.0.0-py2.py3-none-any.whl
Requirement already up-to-date: idna<2.7,>=2.5 in c:\python36\lib\site-packages (from requests<3.0,>=2.0->watson-developer-cloud>=1.2.1)
Requirement already up-to-date: certifi>=2017.4.17 in c:\python36\lib\site-packages (from requests<3.0,>=2.0->watson-developer-cloud>=1.2.1)
Requirement already up-to-date: chardet<3.1.0,>=3.0.2 in c:\python36\lib\site-packages (from requests<3.0,>=2.0->watson-developer-cloud>=1.2.1)
Requirement already up-to-date: urllib3<1.23,>=1.21.1 in c:\python36\lib\site-packages (from requests<3.0,>=2.0->watson-developer-cloud>=1.2.1)
Requirement already up-to-date: six>=1.5 in c:\python36\lib\site-packages (from python_dateutil>=2.5.3->watson-developer-cloud>=1.2.1)
Requirement already up-to-date: txaio>=2.7.0 in c:\python36\lib\site-packages (from autobahn>=0.10.9->watson-developer-cloud>=1.2.1)
Requirement already up-to-date: zope.interface>=4.0.2 in c:\python36\lib\site-packages (from Twisted>=13.2.0->watson-developer-cloud>=1.2.1)
Requirement already up-to-date: constantly>=15.1 in c:\python36\lib\site-packages (from Twisted>=13.2.0->watson-developer-cloud>=1.2.1)
Requirement already up-to-date: incremental>=16.10.1 in c:\python36\lib\site-packages (from Twisted>=13.2.0->watson-developer-cloud>=1.2.1)
Requirement already up-to-date: Automat>=0.3.0 in c:\python36\lib\site-packages (from Twisted>=13.2.0->watson-developer-cloud>=1.2.1)
Requirement already up-to-date: hyperlink>=17.1.1 in c:\python36\lib\site-packages (from Twisted>=13.2.0->watson-developer-cloud>=1.2.1)
Collecting cryptography>=2.1.4 (from pyOpenSSL>=16.2.0->watson-developer-cloud>=1.2.1)
  Using cached cryptography-2.2.2-cp36-cp36m-win_amd64.whl
Collecting pyasn1 (from service-identity>=17.0.0->watson-developer-cloud>=1.2.1)
  Using cached pyasn1-0.4.2-py2.py3-none-any.whl
Collecting pyasn1-modules (from service-identity>=17.0.0->watson-developer-cloud>=1.2.1)
  Using cached pyasn1_modules-0.2.1-py2.py3-none-any.whl
Requirement already up-to-date: attrs in c:\python36\lib\site-packages (from service-identity>=17.0.0->watson-developer-cloud>=1.2.1)
Requirement already up-to-date: setuptools in c:\python36\lib\site-packages (from zope.interface>=4.0.2->Twisted>=13.2.0->watson-developer-cloud>=1.2.1)
Collecting cffi>=1.7; platform_python_implementation != "PyPy" (from cryptography>=2.1.4->pyOpenSSL>=16.2.0->watson-developer-cloud>=1.2.1)
  Using cached cffi-1.11.5-cp36-cp36m-win_amd64.whl
Collecting asn1crypto>=0.21.0 (from cryptography>=2.1.4->pyOpenSSL>=16.2.0->watson-developer-cloud>=1.2.1)
  Using cached asn1crypto-0.24.0-py2.py3-none-any.whl
Collecting pycparser (from cffi>=1.7; platform_python_implementation != "PyPy"->cryptography>=2.1.4->pyOpenSSL>=16.2.0->watson-developer-cloud>=1.2.1)
  Using cached pycparser-2.18.tar.gz
Installing collected packages: Twisted, pycparser, cffi, asn1crypto, cryptography, pyOpenSSL, pyasn1, pyasn1-modules, service-identity, watson-developer-cloud
  Running setup.py install for Twisted: started
    Running setup.py install for Twisted: finished with status 'error'
    Complete output from command c:\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\IPC_AD~1\\AppData\\Local\\Temp\\pip-build-ahl2cx7d\\Twisted\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\IPC_AD~1\AppData\Local\Temp\pip-tqzdkhaj-record\install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.6
    creating build\lib.win-amd64-3.6\twisted
    copying src\twisted\copyright.py -> build\lib.win-amd64-3.6\twisted
    copying src\twisted\plugin.py -> build\lib.win-amd64-3.6\twisted
    copying src\twisted\_version.py -> build\lib.win-amd64-3.6\twisted
    copying src\twisted\__init__.py -> build\lib.win-amd64-3.6\twisted
    . 
    . 
    . 
    . 
    copying src\twisted\words\xish\xpathparser.g -> build\lib.win-amd64-3.6\twisted\words\xish
    running build_ext
    building 'twisted.test.raiser' extension
    error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools

    ----------------------------------------

我尝试从 .wl 安装 twisted by

pip install Twisted-17.9.0-cp37-cp37m-win_amd64.whl

pip install Twisted-17.9.0-cp27-cp27m-win32.whl

都因错误而失败:

Twisted-17.9.0-cp37-cp37m-win_amd64.whl is not a supported wheel on this platform.

我使用的是 Windows 7 64

【问题讨论】:

    标签: python pip twisted ibm-watson


    【解决方案1】:

    unofficial python wheels 安装时,您需要为pythonos 找到合适的wheel

    这看起来像命名约定。

    module  (mod. ver.) (py ver.)  os(32 or 64)  
       ↓        ↓         ↓         ↓
    Twisted-17.9.0-cp36-cp36m-win_amd64.whl
    

    【讨论】:

    • 谢谢,我做了“pip install Twisted-17.9.0-cp37-cp37m-win_amd64.whl”,它成功了!
    • 你用的是哪个python版本?
    • 我使用的是 Python 3.6.1
    • 如果你使用的是 3.6.1,你应该使用 cp36 版本而不是 cp37。它可能有效,但不推荐。
    【解决方案2】:

    我已经通过手动downloading 解决了这个问题,并使用以下命令安装了“Twisted”库。

    pip install Twisted-17.9.0-cp37-cp37m-win_amd64.whl
    

    【讨论】:

    • 如果你使用的是 3.6.1,你应该使用 cp36 版本而不是 cp37。它可能有效,但不推荐。
    • 这个:Twisted-17.9.0-cp36-cp36m-win_amd64.whl
    【解决方案3】:

    谢谢。这对我也有用。得到同样的错误。

    使用手动下载并安装 Twisted 17.9.0 pip install Twisted-17.9.0-cp36-cp36m-win32.whl 并且成功了。

    【讨论】:

      猜你喜欢
      • 2017-12-10
      • 1970-01-01
      • 2018-12-29
      • 1970-01-01
      • 2018-04-25
      • 2020-06-10
      相关资源
      最近更新 更多