Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
AttributeError
#1
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)
Reply
#2
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?
Reply
#3
(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
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020