2015年12月31日 星期四

[python] Google Analytics oauth2client.client.CryptoUnavailableError: No crypto library available 解決方法


[python] Google Analytics oauth2client.client.CryptoUnavailableError: No crypto library available 解決方法


使用 Google Analytics 時遇到

    Traceback (most recent call last):
      File "GAFetcher/cron_ga_fetcher.py", line 31, in <module>
        credentials = SignedJwtAssertionCredentials(client_email, private_key,scope='https://www.googleapis.com/auth/analytics.readonly')
      File "/usr/lib/python2.6/site-packages/oauth2client/util.py", line 140, in positional_wrapper
        return wrapped(*args, **kwargs)
      File "/usr/lib/python2.6/site-packages/oauth2client/client.py", line 1630, in __init__
        _RequireCryptoOrDie()
      File "/usr/lib/python2.6/site-packages/oauth2client/client.py", line 1581, in _RequireCryptoOrDie
        raise CryptoUnavailableError('No crypto library available')
    oauth2client.client.CryptoUnavailableError: No crypto library available

已經 install 了 google-api-python-client
##install
pip install --upgrade google-api-python-client

使用 pip install  PyOpenSSL  可是不能安裝成功

# pip install PyOpenSSL

在centos 上 改採用  成功

# yum install pyOpenSSL

沒有留言:

張貼留言