Pyrebase import fails

Recently updated my app with mail chimp integration but then realized that it did not come up after restart.
Looks like it stops during the import of pyrebase - (see the error message below).
It does not even reach my code … it fails during the pyrebase import. This was running before and it still runs locally - even when I revert my changes it’s still failing with the same message. Any help highly appreciated.

────────────────────── Traceback (most recent call last) ───────────────────────
  /home/adminuser/venv/lib/python3.11/site-packages/streamlit/runtime/scriptru  
  nner/script_runner.py:584 in _run_script                                      
                                                                                
  /mount/src/h2wtest/main.py:2 in <module>                                      
                                                                                
      1 import streamlit as st                                                  
  ❱   2 import pyrebase                                                         
      3 from datetime import datetime                                           
      4 import requests                                                         
      5 import json                                                             
                                                                                
  /home/adminuser/venv/lib/python3.11/site-packages/pyrebase/__init__.py:1 in   
  <module>                                                                      
                                                                                
  ❱ 1 from .pyrebase import initialize_app                                      
    2                                                                           
                                                                                
  /home/adminuser/venv/lib/python3.11/site-packages/pyrebase/pyrebase.py:17 in  
  <module>                                                                      
                                                                                
     14 from sseclient import SSEClient                                         
     15 import threading                                                        
     16 import socket                                                           
  ❱  17 from oauth2client.service_account import ServiceAccountCredentials      
     18 from gcloud import storage                                              
     19 from requests.packages.urllib3.contrib.appengine import is_appengine_s  
     20 from requests_toolbelt.adapters import appengine                        
                                                                                
  /home/adminuser/venv/lib/python3.11/site-packages/oauth2client/service_accou  
  nt.py:25 in <module>                                                          
                                                                                
     22                                                                         
     23 import oauth2client                                                     
     24 from oauth2client import _helpers                                       
  ❱  25 from oauth2client import client                                         
     26 from oauth2client import crypt                                          
     27 from oauth2client import transport                                      
     28                                                                         
                                                                                
  /home/adminuser/venv/lib/python3.11/site-packages/oauth2client/client.py:45   
  in <module>                                                                   
                                                                                
      42 HAS_OPENSSL = False                                                    
      43 HAS_CRYPTO = False                                                     
      44 try:                                                                   
  ❱   45 │   from oauth2client import crypt                                     
      46 │   HAS_CRYPTO = True                                                  
      47 │   HAS_OPENSSL = crypt.OpenSSLVerifier is not None                    
      48 except ImportError:  # pragma: NO COVER                                
                                                                                
  /home/adminuser/venv/lib/python3.11/site-packages/oauth2client/crypt.py:55    
  in <module>                                                                   
                                                                                
     52 │   pkcs12_key_as_pem = _bad_pkcs12_key_as_pem                          
     53                                                                         
     54 try:                                                                    
  ❱  55 │   from oauth2client import _pycrypto_crypt                            
     56 │   PyCryptoSigner = _pycrypto_crypt.PyCryptoSigner                     
     57 │   PyCryptoVerifier = _pycrypto_crypt.PyCryptoVerifier                 
     58 except ImportError:  # pragma: NO COVER                                 
                                                                                
  /home/adminuser/venv/lib/python3.11/site-packages/oauth2client/_pycrypto_cry  
  pt.py:17 in <module>                                                          
                                                                                
     14 """pyCrypto Crypto-related routines for oauth2client."""                
     15                                                                         
     16 from Crypto.Hash import SHA256                                          
  ❱  17 from Crypto.PublicKey import RSA                                        
     18 from Crypto.Signature import PKCS1_v1_5                                 
     19 from Crypto.Util.asn1 import DerSequence                                
     20                                                                         
────────────────────────────────────────────────────────────────────────────────
────────────────────────────────────────────────────────────────────────────────
   /home/adminuser/venv/lib/python3.11/site-packages/Crypto/PublicKey/RSA.py:5  
  85                                                                            
          except ValueError, IndexError:                                        
                 ▲

I was able to solve this by changing in the requirements.txt file the pyrebase modul version: pyrebase → pyrebase4 and then restarting the app.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.