2016-04-11 93 views
1

我正在嘗試使用Python 3.4的python-fitbit包來從Fitbit獲取信息(https://github.com/orcasgit/python-fitbit)。ImportError from python-fitbit

每當我運行它,我得到以下錯誤。現在安裝了oauthlib,我嘗試卸載並重新安裝它無濟於事。任何想法將不勝感激。

File "/usr/local/lib/python3.4/dist-packages/fitbit/__init__.py", line 10, in <module> 

    from .api import Fitbit, FitbitOauth2Client 
    File "/usr/local/lib/python3.4/dist-packages/fitbit/api.py", line 12, in <module> 

    from requests_oauthlib import OAuth2, OAuth2Session 
    File "/usr/local/lib/python3.4/dist-packages/requests_oauthlib/__init__.py", line 1, in <module> 

    from .oauth1_auth import OAuth1 
    File "/usr/local/lib/python3.4/dist-packages/requests_oauthlib/oauth1_auth.py", line 6, in <module> 

    from oauthlib.common import extract_params 
ImportError: No module named 'oauthlib' 

回答

0

在你的文件系統中,你安裝了oauthlib嗎?

請確保oauthlib位於您的Python路徑中。 爲了檢查你的Python路徑,你可以執行:

import sys; print sys.path 
+0

它返回一個列表: '/ usr/lib目錄/ python3/DIST-包', '/家庭/史蒂芬/ PycharmProjects/howareyou', '/usr/lib/python3.4','/usr/lib/python3.4/plat-x86_64-linux-gnu', '/usr/lib/python3.4/lib-dynload', '/ usr/local/lib/python3.4/dist-packages' – Steven

+0

你在哪個文件夾中安裝了oauthlib?它在路上嗎? – Yaron

+0

我用pip安裝在dist-packages文件夾中。我可以看到它的文件夾中太 – Steven