最新谷歌语音API的样本问题(2016年10月)

时间:2016-10-29 13:57:56

标签: python-3.x google-cloud-speech

请怜悯一个菜鸟问题。

我正在使用python(https://cloud.google.com/speech/docs/rest-tutorial)浏览google语音api教程,并完成了以下操作:

  1. 在Google控制台上设置Cloud Speed API项目
  2. 生成/保存的Google服务凭据json文件
  3. 已安装google-api-python-client == 1.5.4并切换到python 3.5 env
  4. 保存了教程中的transcribe.py代码
  5. 保存了教程中的示例audio.raw文件
  6. 执行验证:
  7.   

    $ export   GOOGLE_APPLICATION_CREDENTIALS = my_service_account.json

      

    $ export GCLOUD_PROJECT = my_project_id

    现在我跑

      

    $ python tutorial.py audio.raw

    我得到以下追溯。

    > Traceback (most recent call last):   File "tutorial.py", line 23,
    > in <module>
    >     from googleapiclient import discovery   File "/Users/bonjuice/anaconda/envs/py35/lib/python3.5/site-packages/googleapiclient/discovery.py",
    > line 73, in <module>
    >     from oauth2client.client import GoogleCredentials   File "/Users/bonjuice/anaconda/envs/py35/lib/python3.5/site-packages/oauth2client/client.py",
    > line 45, in <module>
    >     from oauth2client import crypt   File "/Users/bonjuice/anaconda/envs/py35/lib/python3.5/site-packages/oauth2client/crypt.py",
    > line 45, in <module>
    >     from oauth2client import _openssl_crypt   File "/Users/bonjuice/anaconda/envs/py35/lib/python3.5/site-packages/oauth2client/_openssl_crypt.py",
    > line 16, in <module>
    >     from OpenSSL import crypto   File "/Users/bonjuice/anaconda/envs/py35/lib/python3.5/site-packages/OpenSSL/__init__.py",
    > line 8, in <module>
    >     from OpenSSL import rand, crypto, SSL   File "/Users/bonjuice/anaconda/envs/py35/lib/python3.5/site-packages/OpenSSL/rand.py",
    > line 12, in <module>
    >     from OpenSSL._util import (   File "/Users/bonjuice/anaconda/envs/py35/lib/python3.5/site-packages/OpenSSL/_util.py",
    > line 6, in <module>
    >     from cryptography.hazmat.bindings.openssl.binding import Binding   File
    > "/Users/bonjuice/anaconda/envs/py35/lib/python3.5/site-packages/cryptography/hazmat/bindings/openssl/binding.py",
    > line 234, in <module>
    >     Binding.init_static_locks()   File "/Users/bonjuice/anaconda/envs/py35/lib/python3.5/site-packages/cryptography/hazmat/bindings/openssl/binding.py",
    > line 180, in init_static_locks
    >     cls._ensure_ffi_initialized()   File "/Users/bonjuice/anaconda/envs/py35/lib/python3.5/site-packages/cryptography/hazmat/bindings/openssl/binding.py",
    > line 167, in _ensure_ffi_initialized
    >     cls.lib = build_conditional_library(lib, CONDITIONAL_NAMES)   File "/Users/bonjuice/anaconda/envs/py35/lib/python3.5/site-packages/cryptography/hazmat/bindings/openssl/binding.py",
    > line 104, in build_conditional_library
    >     if not getattr(lib, condition): AttributeError: cffi library '_openssl' has no function, constant or global variable named
    > 'Cryptography_HAS_RSA_OAEP_MD'
    

    我做了一些关于“Cryptography_HAS_RSA_OAEP_MD”的搜索,但无济于事。有人可以指点我到哪里错了吗?谢谢!

0 个答案:

没有答案