title: How to set path to unrar library in Python?
body: <p>I am using Pycharm as my IDE (Python 3.7) and am trying to extract a password protected .rar file (I know the password) and have imported rarfile from unrar but am getting this error <strong>"LookupError: Couldn't find path to unrar library." </strong></p>
  
  <p>I also attempted changing my import statement to just say "import rarfile" but instead got the following error <strong> "rarfile.RarCannotExec: Unrar not installed?" </strong></p>
  
  <p>I also tried including this line of code, based on something I found in the rarfile documentation: <em>rarfile.UNRAR_TOOL = "unrar"</em> however I got the same errors.</p>
  
  <p>Here is a snippet of my code:</p>
  
  <pre><code>from unrar import rarfile
  
  def hacker(file_path):
      passwords = open('pwds.txt', 'r')
      with rarfile.RarFile(file_path) as file:
          for line in passwords:
              try:
                  file.pwd = line
                  file.extractall()
              except RuntimeError:
                  pass
  
  
  </code></pre>