title: auto-py-to-exe : module requests not found
body: <p>I got a python script that I want to convert into .exe, I use auto-py-to-exe to do this. My file is inside a folder, which also has text files and pictures which are required for the program to work.</p>
  <p>I fill the fields normally, run it and then try the .exe : <code>module requests not found</code>. Requests is the first import I do in my python script.</p>
  <p>I saw this on Nitratine (<a href="https://nitratine.net/blog/post/issues-when-using-auto-py-to-exe/" rel="nofollow noreferrer">https://nitratine.net/blog/post/issues-when-using-auto-py-to-exe/</a>) :</p>
  <blockquote>
  <p>&quot;ModuleNotFoundError: No module named x / ImportError: No module named x</p>
  </blockquote>
  <p>This means a particular module ('x' in this case) was not added to the package. I have seen this occur with packages in the pandas library and win32api; as long as you can identify the package (e.g. 'x'), then it is very easy to fix.</p>
  <p>To fix this in the UI, open the advanced tab and find the --hidden-import input. Simply paste the module name into this input and then repackage. If the original error is still appearing, you have done this incorrectly.</p>
  <p>For example, if you are missing pandas._libs.tslib, add 'pandas._libs.tslib' into the input by --hidden-import. Additionally, you can add more than one module, for example, pandas._libs.tslib, win32api. (See the question mark by the input for more information).&quot;</p>
  <p>Then, I found this question: <a href="https://stackoverflow.com/questions/58350518/cannot-run-python-file-as-exe-file-getting-error-modulenotfounderror-no-modu">Cannot run Python file as .exe file, getting error &#39;ModuleNotFoundError: No module named &#39;pandas&#39; &#39;</a></p>
  <p>It seems he faced the same error with pandas (quote from Nitratine: &quot;I have seen this occur with packages in the pandas library and win32api&quot;) and followed Nitratine's solution, and it worked.</p>
  <p>He shared a screenshot : <a href="https://i.stack.imgur.com/WMpws.png" rel="nofollow noreferrer">https://i.stack.imgur.com/WMpws.png</a></p>
  <p>So I did the exact same, I put &quot;requests&quot; inside the field, and then... &quot;Failed to execute the script&quot;.</p>
  <p>Mmmmmh.</p>
  <p>How can I resolve this error please?</p>
  <p>EDIT : here are the logs of the command :</p>
  <pre><code>Running auto-py-to-exe v2.7.5
  Building directory: C:\Users\ELVE~1\AppData\Local\Temp\tmpgj8a1e2a
  Provided command: pyinstaller --noconfirm --onedir --windowed --add-data &quot;C:/Hack/ProxyCrawler;ProxyCrawler/&quot; --hidden-import &quot;requests&quot;  &quot;C:/Hack/ProxyCrawler/Script.py&quot;
  Recursion Limit is set to 5000
  Executing: pyinstaller --noconfirm --onedir --windowed --add-data C:/Hack/ProxyCrawler;ProxyCrawler/ --hidden-import requests C:/Hack/ProxyCrawler/Script.py --distpath C:\Users\ELVE~1\AppData\Local\Temp\tmpgj8a1e2a\application --workpath C:\Users\ELVE~1\AppData\Local\Temp\tmpgj8a1e2a\build --specpath C:\Users\ELVE~1\AppData\Local\Temp\tmpgj8a1e2a
  
  49308 INFO: PyInstaller: 3.6
  49321 INFO: Python: 3.7.7
  49334 INFO: Platform: Windows-10-10.0.17763-SP0
  49343 INFO: wrote C:\Users\ELVE~1\AppData\Local\Temp\tmpgj8a1e2a\Script.spec
  49358 INFO: UPX is not available.
  49391 INFO: Extending PYTHONPATH with paths
  ['C:\\Hack\\ProxyCrawler',
   'C:\\Users\\ELVE~1\\AppData\\Local\\Temp\\tmpgj8a1e2a']
  49401 INFO: checking Analysis
  49406 INFO: Building Analysis because Analysis-00.toc is non existent
  49418 INFO: Initializing module dependency graph...
  49521 INFO: Caching module graph hooks...
  49568 INFO: Analyzing base_library.zip ...
  56240 INFO: Processing pre-find module path hook   distutils
  56269 INFO: distutils: retargeting to non-venv dir 'c:\\panda3d-1.10.6-x64\\python\\lib'
  61992 INFO: Caching module dependency graph...
  62249 INFO: running Analysis Analysis-00.toc
  62301 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
    required by c:\panda3d-1.10.6-x64\python\python.exe
  62521 INFO: Analyzing C:\Hack\ProxyCrawler\Script.py
  63303 INFO: Processing pre-safe import module hook   urllib3.packages.six.moves
  69165 INFO: Processing module hooks...
  69170 INFO: Loading module hook &quot;hook-certifi.py&quot;...
  69191 INFO: Loading module hook &quot;hook-distutils.py&quot;...
  69209 INFO: Loading module hook &quot;hook-encodings.py&quot;...
  69456 INFO: Loading module hook &quot;hook-pydoc.py&quot;...
  69466 INFO: Loading module hook &quot;hook-sysconfig.py&quot;...
  69479 INFO: Loading module hook &quot;hook-xml.py&quot;...
  69807 INFO: Loading module hook &quot;hook-_tkinter.py&quot;...
  70226 INFO: checking Tree
  70233 INFO: Building Tree because Tree-00.toc is non existent
  70246 INFO: Building Tree Tree-00.toc
  70500 INFO: checking Tree
  70507 INFO: Building Tree because Tree-01.toc is non existent
  70521 INFO: Building Tree Tree-01.toc
  70603 INFO: Looking for ctypes DLLs
  70610 INFO: Analyzing run-time hooks ...
  70630 INFO: Including run-time hook 'pyi_rth__tkinter.py'
  70659 INFO: Including run-time hook 'pyi_rth_certifi.py'
  70695 INFO: Looking for dynamic libraries
  71326 INFO: Looking for eggs
  71334 INFO: Using Python library c:\panda3d-1.10.6-x64\python\python37.dll
  71347 INFO: Found binding redirects: 
  []
  71362 INFO: Warnings written to C:\Users\ELVE~1\AppData\Local\Temp\tmpgj8a1e2a\build\Script\warn-Script.txt
  71481 INFO: Graph cross-reference written to C:\Users\ELVE~1\AppData\Local\Temp\tmpgj8a1e2a\build\Script\xref-Script.html
  71552 INFO: Appending 'datas' from .spec
  71570 INFO: checking PYZ
  71580 INFO: Building PYZ because PYZ-00.toc is non existent
  71586 INFO: Building PYZ (ZlibArchive) C:\Users\ELVE~1\AppData\Local\Temp\tmpgj8a1e2a\build\Script\PYZ-00.pyz
  72799 INFO: Building PYZ (ZlibArchive) C:\Users\ELVE~1\AppData\Local\Temp\tmpgj8a1e2a\build\Script\PYZ-00.pyz completed successfully.
  72843 INFO: checking PKG
  72851 INFO: Building PKG because PKG-00.toc is non existent
  72861 INFO: Building PKG (CArchive) PKG-00.pkg
  72927 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.
  72938 INFO: Bootloader c:\panda3d-1.10.6-x64\python\lib\site-packages\PyInstaller\bootloader\Windows-64bit\runw.exe
  72953 INFO: checking EXE
  72963 INFO: Building EXE because EXE-00.toc is non existent
  72993 INFO: Building EXE from EXE-00.toc
  73024 INFO: Appending archive to EXE C:\Users\ELVE~1\AppData\Local\Temp\tmpgj8a1e2a\build\Script\Script.exe
  73219 INFO: Building EXE from EXE-00.toc completed successfully.
  73239 INFO: checking COLLECT
  73247 INFO: Building COLLECT because COLLECT-00.toc is non existent
  73265 INFO: Building COLLECT COLLECT-00.toc
  87856 INFO: Building COLLECT COLLECT-00.toc completed successfully.
  
  Moving project to: C:\Users\Elève\output
  Complete.
  </code></pre>
  <p>(I'm french so it's normal if you don't understand names like &quot;Elève&quot; (student) or so)</p>
  <p>EDIT N°2 :
  Eric Mathieu tried to help me through comments, and he mentionned &quot;build&quot; and &quot;dist&quot; folders that should appear. I don't get any of them, and while following a tutorial to try get more help I found this :</p>
  <p><a href="https://datatofish.com/wp-content/uploads/2019/03/004_pyinstaller.png" rel="nofollow noreferrer">https://datatofish.com/wp-content/uploads/2019/03/004_pyinstaller.png</a></p>
  <p>So he got a &quot;pycache&quot; folder (I can't put the two _ because else the word pycache becomes bold ^^'), a &quot;dist&quot; and a &quot;build&quot; one also. I have &quot;pycache&quot;, but none of &quot;dist&quot; or &quot;build&quot;... Maybe this can help ?</p>
  <p>The tutorial I talk about is here : <a href="https://datatofish.com/executable-pyinstaller/" rel="nofollow noreferrer">https://datatofish.com/executable-pyinstaller/</a></p>