error with cx_freeze python

0

these are my scripts:

import firebase_admin
from firebase_admin import db
from firebase_admin import credentials
import threading

def login():
    cred = credentials.Certificate("C:/Users/Angel/Desktop/N_Proyect/fire/New_Firebase.json")
    firebase_admin.initialize_app(cred,{
            'databaseURL':'https://new1-3b819.firebaseio.com/'
    })
t = threading.Thread(target=login)
t.start()
t.join()
from PyQt5.QtWidgets import QApplication, QMainWindow
from PyQt5 import uic, QtCore
from Firebase_load import login


class Inicio(QMainWindow):
    def __init__(self):
        QMainWindow.__init__(self)
        uic.loadUi("C:/Users/Angel/Desktop/N_Proyect/Interfaces/Inicio.ui",self)

        self.setWindowFlags(QtCore.Qt.FramelessWindowHint)
        self.setAttribute(QtCore.Qt.WA_TranslucentBackground,True)
        self.setAttribute(QtCore.Qt.WA_NoSystemBackground,False)

        self.closed.clicked.connect(lambda:self.close())
        self.minim.clicked.connect(lambda:self.showMinimized())
        self.Maxim.clicked.connect(self.tamano_Principal)

        self.timer = QtCore.QTimer(self)
        self.timer.setInterval(1000)
        self.timer.timeout.connect(self.mostrar_hora)
        self.timer.start()


    def tamano_Principal(self):
        if self.isMaximized():
            self.showNormal()
        else:
            self.showMaximized()

    def mostrar_hora(self):

        self.hora.setText(QtCore.QDateTime.currentDateTime().toString("hh:mm:ss  AP"))




#app = QApplication([])
#i = Inicio()
#i.show()
#app.exec_()
from PyQt5.QtWidgets import QMainWindow, QApplication
from PyQt5 import uic, QtCore, Qt
import threading
from Inicio import *
from Firebase_load import *

class Principal(QMainWindow):
    def __init__(self):
        QMainWindow.__init__(self)
        uic.loadUi("C:/Users/Angel/Desktop/N_Proyect/Interfaces/Login.ui",self)

        self.setWindowFlags(QtCore.Qt.FramelessWindowHint)
        self.setAttribute(QtCore.Qt.WA_TranslucentBackground,True)
        self.setAttribute(QtCore.Qt.WA_NoSystemBackground,False)

        self.closed.clicked.connect(lambda:self.close())
        t = threading.Thread(target=self.mostrar_hora)
        t.start()

        self.timer = QtCore.QTimer(self)
        self.timer.setInterval(1000)
        self.timer.timeout.connect(self.mostrar_hora)
        self.timer.start()

    def mostrar_hora(self):
        self.hora.setText(QtCore.QDateTime.currentDateTime().toString("hh:mm:ss AP"))



class Dato(Principal):
    def __init__(self):
        Principal.__init__(self)
        self.b_login.clicked.connect(self.validate_User)

    def validate_User(self):
        user = self.l_usuario.text()

        if user == '':
            self.l_status.setText('No se ingreso un usuario')
        else:
            ref = db.reference("/usuarios")
            res = ref.get()

            for key in res.items():
                if key[1]['usuario'] == user:
                    ref_pass = key[0] #nombre
                    self.l_status.setText('')
                    self.validate_password(ref_pass)
                    break
                else:
                    self.l_status.setText("El usuario "+ user +" no fue encontrado")
                    break

    def validate_password(self,user):
        password  = self.l_password.text()

        refp = db.reference("/usuarios/"+user)
        res = refp.get()

        for key in res.items():
            if key[0] == 'password':
                if key[1] == password:
                    self.other()
                else:
                    self.l_password.setText('')
                    self.l_status.setText("Invalidate Password")



    def other(self):
        self.close()
        self.inicio = Inicio()
        self.inicio.user.setText(self.l_usuario.text())
        self.inicio.show()

app = QApplication([])
p = Dato()
p.show()
app.exec_()

Files

    
asked by Mystic_Force 06.08.2018 в 05:30
source

2 answers

0

The solution to the error is simple just look for the path where the google module is located in python example: C:\Users\Nombre_de_Usuario\AppData\Local\Programs\Python\Python36\Lib\site-packages\google , and create an empty file with the name __init__.py

    
answered by 19.09.2018 / 06:10
source
0

the error that marks the dialogue at the end is No Module Named 'Google', which indicates that you do not have that module installed or you have not activated your virtual environment, try to run pip freeze , to verify if you have it installed.

    
answered by 06.08.2018 в 06:55