Python Forum

Full Version: AttributeError
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
import unrar

# Open the RAR3 file
rar = unrar.RarFile('hash.rar')

# Get the password hash of the RAR3 file
password_hash = rar.password_hash

# Print the password hash
print(password_hash)
Error message that I am getting can't find a way to resolve this
Error:
AttributeError: partially initialized module 'unrar' has no attribute 'RarFile' (most likely due to a circular import)
In the examples of unrar I read this:
Quote:>>> from unrar import rarfile
>>> rar = rarfile.RarFile('sample.rar')

But you import unrar. So my guess is you have to change line 4 to:
rar = unrar.rarfile.RarFile('hash.rar')
Am I right?
(Dec-25-2022, 10:45 AM)ibreeden Wrote: [ -> ]In the examples of unrar I read this:
Quote:>>> from unrar import rarfile
>>> rar = rarfile.RarFile('sample.rar')

But you import unrar. So my guess is you have to change line 4 to:
rar = unrar.rarfile.RarFile('hash.rar')
Am I right?

yes you're right