title: Pyinstaller error ImportError: No module named 'requests.packages.chardet.sys
body: <p>I can't seem to find the root cause of this.  I don't know if it's pyinstaller, a pip problem, the requests module, or something else as nothing can be eliminated conclusively.</p>
  
  <p>I wrote a script in python that properly configures a new hardware sonicwall for our enterprise network when we have to deploy a new unit.  It configures a proper .exp file in memory, logs into the sonicwall device with default credentials, imports the file via a multi-part data form, restarts the sonicwall, then logs in again and changes the shared secret properly.  For security reasons, I can't post the code here, but I can explain the problem with a much simpler example.  Previously, the code was using urllib and urllib2 to process http requests, but then I discovered the requests module when I had to re-write the script to include csrfTokens.</p>
  
  <p>Long story short, the script works amazing when called by the python interpreter.  However, when trying to compile it with pyinstaller, I get a series of errors now that I've switched to requests instead of the urllibs.</p>
  
  <p>Some more background:</p>
  
  <pre><code>Windows 7 - Python2.7.9
  pip 6.0.8 from C:\Python27\lib\site-packages\pip-6.0.8-py2.7.egg (python 2.7)
  pip freeze output:
  pyinstaller==2.1.1.dev0
  pywin32==219
  requests==2.5.3
  </code></pre>
  
  <p>As an example, I'll give you some code that bombs out, a simple request to google.</p>
  
  <pre><code>#!/usr/bin/python
  import requests 
  r = requests.get('https://google.com') 
  print(r.text)
  </code></pre>
  
  <p>The above code works for a simple request when I call the file from python, but when I compile it, I get this:</p>
  
  <p>(EDIT Having problems pasting output, here is the pastebin)
  <a href="http://pastebin.com/dpF4wweJ" rel="noreferrer">pastebin</a></p>
  
  <p>It creates a windows executable, but this is the following error when I try to run it:</p>
  
  <p><em>NOTE</em>  I did install the ms c++ 2008 redistributable to help clear up the msvcr90.dll, but I still get the above requests.packages.chardet.sys error.</p>
  
  <p>I've tried everything I can think of, installing chardet, installing chardet2, installing cchardet, forcing earlier versions of pyinstaller and requests incrementally.  Scrapping pip and manually installing pyinstaler and requests.  I'm at my wits end with things to try, I don't quite get the error on hand here.  requests.packages.chardet exists on the system.  I also have C:\Python27 in my windows PATH as I can call python from any directory.</p>
  
  <p>If you need more information, please let me know.  I tried to be as thorough with the errors as possible and what I have installed, but I can provide more if needed.</p>
  
  <p><em>ALSO</em>  This issue ONLY appears to be happening when I try to compile when I import requests.  creating test scripts, beautifulsoup, urllib/2, etc all compile a valid windows exe that runs properly.</p>