python文件显示AttributeError:模块“ http”没有属性“ client”

我有以下 Python 脚本:


import http

import requests

from bs4 import BeautifulSoup

import urllib3

import pyrebase

import numpy as np

import yagmail

import time

from datetime import datetime, timedelta

import sys

import logging

import colorama

import csv

from random import randint

from numpy import genfromtxt

import sched, time

import threading

import http.client


import firebase_admin

from firebase_admin import credentials

from firebase_admin import db



# Fetch the service account key JSON file contents

cred = credentials.Certificate('service-account-credentials.json')

# Initialize the app with a service account, granting admin privileges

firebase_admin.initialize_app(cred, {

    'databaseURL': 'https://werrwrrw-catalogue.firebaseio.com'

})



config = {

    "apiKey": "BiXzaSdwhjwrhwjjrhwr",

    "authDomain": "whjwrhwjjrhwr.firebaseapp.com",

    "databaseURL": "https://whjwrhwjjrhwr.firebaseio.com",

    "projectId": "whjwrhwjjrhwr",

    "storageBucket": "rewrrrrr.appspot.com",

    "messagingSenderId": "606543434441"

}




firebaseuser = pyrebase.initialize_app(config)


auth = firebaseuser.auth()

dbuser = firebaseuser.database()


subref = db.reference('Subcribers').get()


for key, val in subref.items():

    subcriber_email = val['Email']

    print(key,subcriber_email)

我无法真正查明错误。我如何基于上述回溯读取修复错误?


HUX布斯
浏览 272回答 3
3回答

HUH函数

可能是 Bs4 引发了异常,请在现有的一个中执行以下脚本验证 Bs4 导入工作正常try:    from bs4 import BeautifulSoupexcept Exception as err:    raise ImportError('Bs4 is not imported correctly. - {}'.format(err))

素胚勾勒不出你

我自己也不是专家,但请尝试在第一行中进行此操作import http as http_因为我在错误消息中看到 python 试图client从 http模块获取我的猜测是因为有 http 模块和 http 文件夹,其中文件夹包含其他模块(如客户端)
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python