thisbejim / Pyrebase

A simple python wrapper for the Firebase API.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crypto Error on import pyrebase

robertkstarr opened this issue · comments

I'm getting the following error when running import pyrebase:

>>> import pyrebase
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.9/site-packages/pyrebase/__init__.py", line 1, in <module>
    from .pyrebase import initialize_app
  File "/usr/local/lib/python3.9/site-packages/pyrebase/pyrebase.py", line 17, in <module>
    from oauth2client.service_account import ServiceAccountCredentials
  File "/usr/local/lib/python3.9/site-packages/oauth2client/service_account.py", line 25, in <module>
    from oauth2client import client
  File "/usr/local/lib/python3.9/site-packages/oauth2client/client.py", line 47, in <module>
    from oauth2client import crypt
  File "/usr/local/lib/python3.9/site-packages/oauth2client/crypt.py", line 55, in <module>
    from oauth2client import _pycrypto_crypt
  File "/usr/local/lib/python3.9/site-packages/oauth2client/_pycrypto_crypt.py", line 17, in <module>
    from Crypto.PublicKey import RSA
  File "/usr/local/lib/python3.9/site-packages/Crypto/PublicKey/__init__.py", line 29, in <module>
    from Crypto.Util.asn1 import (DerSequence, DerInteger, DerBitString,
  File "/usr/local/lib/python3.9/site-packages/Crypto/Util/asn1.py", line 33, in <module>
    from Crypto.Util.number import long_to_bytes, bytes_to_long
  File "/usr/local/lib/python3.9/site-packages/Crypto/Util/number.py", line 398
    s = pack('>I', n & 0xffffffffL) + s
                                 ^
SyntaxError: invalid syntax

It was working fine just a few days ago.

Thanks for your hard work!

Having this issue too, did you find a solution @rstarr-indeed ?

@benthecoder I haven't looked into this since reporting the error, so no I haven't. I'm waiting for a new version that will (fingers crossed) fix it.

I unistalled pycryptodome and installed pycryptodome again and it is now working

pip uninstall pycryptodome
pip install pycryptodome

I unistalled pycryptodome and installed pycryptodome again and it is now working

pip uninstall pycryptodome
pip install pycryptodome

This worked for me! Thanks!

An alternative solution is to install Pyrebase4.

This

I unistalled pycryptodome and installed pycryptodome again and it is now working

pip uninstall pycryptodome
pip install pycryptodome

This worked for me! Thanks!

This worked for me, I updated my project from python 3.7 to 3.11 and after installing pycrypto I faced an error.
error: value |= 2L ** (N-1) # Ensure high bit is set
I searched for the solution and here I got it so I just installed pycryptodome and it worked for me.