spruceid / siwe-py

A Python implementation of Sign-In with Ethereum
https://login.xyz
Apache License 2.0
66 stars 28 forks source link

Not able to import siwe #28

Closed dhruvildave22 closed 2 years ago

dhruvildave22 commented 2 years ago

Hello, I want to use siwe for one of my project in python. However i am having an issue. When i try to import siwe in file it gives me error. I tried to import in different ways.

from siwe.siwe import SiweMessage
ModuleNotFoundError: No module named 'siwe.siwe'; 'siwe' is not a package
from siwe import siwe
ImportError: cannot import name 'siwe' from 'siwe'

and used this

siwe.SiweMessage({})

but it did not work. At last i used this

import siwe

and it worked but how do i access SiweMessage and other classes coming from siwe library. Please Help.

Thanks Dhruvil Dave

sbihel commented 2 years ago

Looks like the namespacing is not what I expected. Although it seems from siwe import siwe should work withing the repl, and from siwe.siwe import ... has been used in other projects. May I ask what version of Python you're using? And maybe your OS/arch as well?

29 will make the package behave as one would expect (from siwe import SiweMessage) and should be released with the 2.0 version which should come in the next few days.

dhruvildave22 commented 2 years ago

I am using python 3.7 on macOS Monterey(M1 chip)

SonalBhanawat commented 2 years ago

@sbihel - by when can we expect the next version to be released ?

w4ll3 commented 2 years ago

It should be release next Monday with the rest of the siwe libraries

sbihel commented 2 years ago

Closed by #29. v2.0.0 has now been released.