title: PyInstaller Hidden Imports
body: <p>I have a fully working Python program that uses the following imports:</p>
  
  <pre><code>import json
  import requests
  from natsort import natsorted
  </code></pre>
  
  <p>However, when I try to compile it to an executable using PyInstaller, I get the following errors:</p>
  
  <p>Note: May not be perfect, as it was captured by my reaction times and a screenshot:</p>
  
  <pre><code>File "site-packages\requests\packages\urllib3\packages\six.py", line 82, in _import_module
  ImportError: No module named 'queue'
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
  File "huepy3.py", line 2, in &lt;module&gt;
  File "c:\users\andrew\appdata\local\programs\python\python35-32\lib\site-packages\PyInstaller\loader\pyimodo3_importer
  py", line 389, in load_module
  exec(bytecode, module.__dict__)
  File "site-packages\requests\__init__.py", line 63, in &lt;module&gt;
  File "c:\users\andrew\appdata\local\programs\python\python35-32\lib\site-packages\PyInstaller\loader\pyimodo3_importer
  py", line 389, in load_module
  exec(bytecode, module.__dict__)
  File "site-packages\requests\utils.py", line 24, in &lt;module&gt;
  File "c:\users\andrew\appdata\local\programs\python\python35-32\lib\site-packages\PyInstaller\loader\pyimodo3_importer
  py", line 389, in load_module
  exec(bytecode, module.__dict__)
  File "site-packages\requests\_internal_utils.py", line 11, in &lt;module&gt;
  File "c:\users\andrew\appdata\local\programs\python\python35-32\lib\site-packages\PyInstaller\loader\pyimodo3_importer
  py", line 389, in load_module
  exec(bytecode, module.__dict__)
  File "site-packages\requests\compat.py", line 11, in &lt;module&gt;
  File "c:\users\andrew\appdata\local\programs\python\python35-32\lib\site-packages\PyInstaller\loader\pyimodo3_importer
  py", line 389, in load_module
  exec(bytecode, module.__dict__)
  File "site-packages\requests\packages\__init__.py", line 29, in &lt;module&gt;
  ImportError: No module named 'urllib3'
  Failed to execute script huepy3
  </code></pre>
  
  <p>I read the error, and tried to import urllib3 in my code as well. That returned the same errors as well. I'm thinking it's down to the location of urllib3 in relation to requests, but how can I solve this? I read online about FileDialog, and again it returned the same error.</p>
  
  <p>Any pointers on this would be much appreciated.</p>
  
  <p>Edit: It's not just the queue import problem, it's more of how to change the paths the library requests is trying to import from and how pyinstaller is going to get those paths in the first instance.</p>
  
  <p>Edit 2: Ok, maybe I should ask how PyInstaller compiles the dependencies it finds and where it stores them? I could then give it a shot myself.</p>
  
  <p>Edit 3: Through hours of crawling the web I believe I might be after hidden imports. How do those works for getting urllib3 in?</p>