2017-03-16 2 views
1

최근에 Pyrebase로 작업을 시작했고 Python 2.7.13을 설치하고 Pyrebase를 설치 한 후 모듈 http_client가 누락되어 HTTPConnection을 가져올 수 없습니다. 나는 pyrebase를 제거하고 그것을 다시 설치하여이 모듈이 이번에는 모두 포함될 수 있는지 알아 보았지만 여전히 모듈 http_client가 존재하지 않는다는 동일한 가져 오기 오류가 발생합니다. 어떤 아이디어?ImportError : No module http_client

다음
import pyrebase 

config = { 
    "apiKey": "AIzaSyBYJ9WC68XJg6jGwAGwwxT3wcvGAti4FOg", 
    "authDomain": "app-2-b1b3e.firebaseapp.com", 
    "databaseURL": "https://app-2-b1b3e.firebaseio.com/", 
    "storageBucket": "app-2-b1b3e.appspot.com" 
} 

fb = pyrebase.initialize_app(config) 
firebase = fb.database() 
def dataSentTest(): 
    data = {"name": "Mortimer 'Morty' Smith"} 
    firebase.child("users").child("Morty").set(data) 

dataSentTest() 

오류 메시지입니다 : 여기

코드입니다

Traceback (most recent call last): 
File "/Users/sam/Desktop/Selfie Dash/DataListener.py", line 1, in  <module> 
import pyrebase 
File "/Library/Python/2.7/site-packages/pyrebase/__init__.py", line 1,  in <module> 
from .pyrebase import initialize_app 
File "/Library/Python/2.7/site-packages/pyrebase/pyrebase.py", line 18, in <module> 
from gcloud import storage 
File "/Library/Python/2.7/site-packages/gcloud/storage/__init__.py", line 43, in <module> 
from gcloud.storage.blob import Blob 
File "/Library/Python/2.7/site-packages/gcloud/storage/blob.py", line 30, in <module> 
from gcloud._helpers import _rfc3339_to_datetime 
File "/Library/Python/2.7/site-packages/gcloud/_helpers.py", line 30, in <module> 
from six.moves.http_client import HTTPConnection 
ImportError: No module named http_client 
[Finished in 0.5s with exit code 1] 

감사합니다!

답변

0

이것은 당신이 이러한 종속성을 설치 제안 pytrebase의 requirements.txt 파일

requests==2.11.1 
gcloud==0.17.0 
oauth2client==3.0.0 
requests-toolbelt==0.7.0 
python-jwt==2.0.1 
pycrypto==2.6.1 

이다, 명령

pip install -r requirements.txt