title: How to fix AttributeError: type object 'CookieJar' has no attribute 'LWPCookieJar'?
body: <p>I am using cookielib(cookiejar named now in Python3) and mechanize. </p>
  
  <p>I am importing this way</p>
  
  <pre class="lang-py prettyprint-override"><code>import requests
  from bs4 import BeautifulSoup
  import mechanize
  try:
      from cookielib import Cookie, CookieJar         
  except ImportError:
      from http.cookiejar import Cookie, CookieJar as cookielib    
  </code></pre>
  
  <p>but I keep getting this error <strong>(AttributeError: type object 'CookieJar' has no attribute 'LWPCookieJar')</strong> at this point of my code</p>
  
  <pre class="lang-py prettyprint-override"><code># Cookie Jar
  cj = cookielib.LWPCookieJar()
  br.set_cookiejar(cj)
  </code></pre>
  
  <p>Any ideas?</p>
  
  <p>Thanks a lot for your time!</p>