title: Pyinstaller issue in packaging exe program on win10
body: <p>Currently i meet issue while packaging exe through pyinstaller .</p>
  <p>I create a virtual environmental under pycharm , and my programe is very simple</p>
  <pre><code>a = input(&quot;please input a :&quot;)
  b = input(&quot;please input b: &quot;)
  
  c = print(a+b)
  </code></pre>
  <p>the code stored in test.py . and then I type <code>pyinstaller -F test.py</code> on pycharm consle , it shows as below . as you seen , many libs not found , and packaing failed .</p>
  <pre><code>(venv) C:\cheng\Project\STC_Tool\venv&gt;pyinstaller -v
  3.6
  
  (venv) C:\cheng\Project\STC_Tool\venv&gt;pyinstaller -F test.py
  67 INFO: PyInstaller: 3.6
  67 INFO: Python: 3.7.8
  70 INFO: Platform: Windows-10-10.0.18362-SP0
  72 INFO: wrote C:\cheng\Project\STC_Tool\venv\test.spec
  73 INFO: UPX is not available.
  74 INFO: Extending PYTHONPATH with paths
  ['C:\\cheng\\Project\\STC_Tool\\venv', 'C:\\cheng\\Project\\STC_Tool\\venv']
  75 INFO: checking Analysis
  77 INFO: Building because C:\cheng\Project\STC_Tool\venv\test.py changed
  78 INFO: Initializing module dependency graph...
  80 INFO: Caching module graph hooks...
  83 INFO: Analyzing base_library.zip ...
  2178 INFO: Processing pre-find module path hook   distutils
  2191 INFO: distutils: retargeting to non-venv dir 'C:\\cheng\\Software\\Python\\lib'
  3247 INFO: Caching module dependency graph...
  3348 INFO: running Analysis Analysis-00.toc
  3351 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
    required by c:\cheng\project\stc_tool\venv\scripts\python.exe
  3365 WARNING: lib not found: VERSION.dll dependency of c:\cheng\project\stc_tool\venv\scripts\python.exe
  3371 INFO: Analyzing C:\cheng\Project\STC_Tool\venv\test.py
  3373 INFO: Processing module hooks...
  3374 INFO: Loading module hook &quot;hook-distutils.py&quot;...
  3375 INFO: Loading module hook &quot;hook-encodings.py&quot;...
  3656 INFO: Loading module hook &quot;hook-pydoc.py&quot;...
  3657 INFO: Loading module hook &quot;hook-sysconfig.py&quot;...
  3659 INFO: Loading module hook &quot;hook-xml.py&quot;...
  3910 INFO: Looking for ctypes DLLs
  3915 INFO: Analyzing run-time hooks ...
  3917 INFO: Looking for dynamic libraries
  3937 WARNING: lib not found: VCRUNTIME140.dll dependency of C:\cheng\Software\Python\DLLs\select.pyd
  3947 WARNING: lib not found: python37.dll dependency of C:\cheng\Software\Python\DLLs\select.pyd
  3966 WARNING: lib not found: VCRUNTIME140.dll dependency of C:\cheng\Software\Python\DLLs\_socket.pyd
  3974 WARNING: lib not found: python37.dll dependency of C:\cheng\Software\Python\DLLs\_socket.pyd
  3978 WARNING: lib not found: VCRUNTIME140.dll dependency of C:\cheng\Software\Python\DLLs\_lzma.pyd
  3994 WARNING: lib not found: python37.dll dependency of C:\cheng\Software\Python\DLLs\_lzma.pyd
  4001 WARNING: lib not found: VCRUNTIME140.dll dependency of C:\cheng\Software\Python\DLLs\_bz2.pyd
  4027 WARNING: lib not found: python37.dll dependency of C:\cheng\Software\Python\DLLs\_bz2.pyd
  4052 WARNING: lib not found: VCRUNTIME140.dll dependency of C:\cheng\Software\Python\DLLs\_hashlib.pyd
  4062 WARNING: lib not found: python37.dll dependency of C:\cheng\Software\Python\DLLs\_hashlib.pyd
  4071 WARNING: lib not found: libcrypto-1_1.dll dependency of C:\cheng\Software\Python\DLLs\_hashlib.pyd
  4079 WARNING: lib not found: libssl-1_1.dll dependency of C:\cheng\Software\Python\DLLs\_ssl.pyd
  4095 WARNING: lib not found: VCRUNTIME140.dll dependency of C:\cheng\Software\Python\DLLs\_ssl.pyd
  4097 WARNING: lib not found: python37.dll dependency of C:\cheng\Software\Python\DLLs\_ssl.pyd
  4106 WARNING: lib not found: libcrypto-1_1.dll dependency of C:\cheng\Software\Python\DLLs\_ssl.pyd
  4128 WARNING: lib not found: VCRUNTIME140.dll dependency of C:\cheng\Software\Python\DLLs\unicodedata.pyd
  4141 WARNING: lib not found: python37.dll dependency of C:\cheng\Software\Python\DLLs\unicodedata.pyd
  4161 WARNING: lib not found: VCRUNTIME140.dll dependency of C:\cheng\Software\Python\DLLs\pyexpat.pyd
  4171 WARNING: lib not found: python37.dll dependency of C:\cheng\Software\Python\DLLs\pyexpat.pyd
  4174 INFO: Looking for eggs
  4174 INFO: Python library not in binary dependencies. Doing additional searching...
  4180 INFO: Using Python library
  4180 INFO: Found binding redirects:
  []
  4194 INFO: Warnings written to C:\cheng\Project\STC_Tool\venv\build\test\warn-test.txt
  4252 INFO: Graph cross-reference written to C:\cheng\Project\STC_Tool\venv\build\test\xref-test.html
  4261 INFO: checking PYZ
  4268 INFO: Building because toc changed
  4270 INFO: Building PYZ (ZlibArchive) C:\cheng\Project\STC_Tool\venv\build\test\PYZ-00.pyz
  4875 INFO: Building PYZ (ZlibArchive) C:\cheng\Project\STC_Tool\venv\build\test\PYZ-00.pyz completed successfully.
  4890 INFO: checking PKG
  4891 INFO: Building because toc changed
  4893 INFO: Building PKG (CArchive) PKG-00.pkg
  Traceback (most recent call last):
    File &quot;C:\cheng\Software\Python\lib\runpy.py&quot;, line 193, in _run_module_as_main
      &quot;__main__&quot;, mod_spec)
    File &quot;C:\cheng\Software\Python\lib\runpy.py&quot;, line 85, in _run_code
      exec(code, run_globals)
    File &quot;C:\cheng\Project\STC_Tool\venv\Scripts\pyinstaller.exe\__main__.py&quot;, line 7, in &lt;module&gt;
    File &quot;c:\cheng\project\stc_tool\venv\lib\site-packages\PyInstaller\__main__.py&quot;, line 114, in run
      run_build(pyi_config, spec_file, **vars(args))
    File &quot;c:\cheng\project\stc_tool\venv\lib\site-packages\PyInstaller\__main__.py&quot;, line 65, in run_build
      PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
    File &quot;c:\cheng\project\stc_tool\venv\lib\site-packages\PyInstaller\building\build_main.py&quot;, line 734, in main
      build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
    File &quot;c:\cheng\project\stc_tool\venv\lib\site-packages\PyInstaller\building\build_main.py&quot;, line 681, in build
      exec(code, spec_namespace)
    File &quot;C:\cheng\Project\STC_Tool\venv\test.spec&quot;, line 33, in &lt;module&gt;
      console=True )
    File &quot;c:\cheng\project\stc_tool\venv\lib\site-packages\PyInstaller\building\api.py&quot;, line 436, in __init__
      upx_exclude=self.upx_exclude
    File &quot;c:\cheng\project\stc_tool\venv\lib\site-packages\PyInstaller\building\api.py&quot;, line 199, in __init__
      self.__postinit__()
    File &quot;c:\cheng\project\stc_tool\venv\lib\site-packages\PyInstaller\building\datastruct.py&quot;, line 160, in __postinit__
      self.assemble()
    File &quot;c:\cheng\project\stc_tool\venv\lib\site-packages\PyInstaller\building\api.py&quot;, line 262, in assemble
      dist_nm=inm)
    File &quot;c:\cheng\project\stc_tool\venv\lib\site-packages\PyInstaller\building\utils.py&quot;, line 220, in checkCache
      digest = cacheDigest(fnm, redirects)
    File &quot;c:\cheng\project\stc_tool\venv\lib\site-packages\PyInstaller\building\utils.py&quot;, line 365, in cacheDigest
      with open(fnm, &quot;rb&quot;) as f:
  FileNotFoundError: [Errno 2] No such file or directory: ''
  </code></pre>
  <p>if I remobve <code>-F</code> option and type <code>pyinstaller test.py</code> directly , the packaing would be successfully</p>
  <pre><code>(venv) C:\cheng\Project\STC_Tool\venv&gt;pyinstaller test.py
  65 INFO: PyInstaller: 3.6
  65 INFO: Python: 3.7.8
  66 INFO: Platform: Windows-10-10.0.18362-SP0
  68 INFO: wrote C:\cheng\Project\STC_Tool\venv\test.spec
  70 INFO: UPX is not available.
  70 INFO: Extending PYTHONPATH with paths
  ['C:\\cheng\\Project\\STC_Tool\\venv', 'C:\\cheng\\Project\\STC_Tool\\venv']
  70 INFO: checking Analysis
  75 INFO: checking PYZ
  98 INFO: checking PKG
  98 INFO: Building because toc changed
  99 INFO: Building PKG (CArchive) PKG-00.pkg
  125 INFO: Building PKG (CArchive) PKG-00.pkg completed successfully.
  128 INFO: Bootloader c:\cheng\project\stc_tool\venv\lib\site-packages\PyInstaller\bootloader\Windows-32bit\run.exe
  129 INFO: checking EXE
  131 INFO: Building because toc changed
  132 INFO: Building EXE from EXE-00.toc
  134 INFO: Appending archive to EXE C:\cheng\Project\STC_Tool\venv\build\test\test.exe
  137 INFO: Building EXE from EXE-00.toc completed successfully.
  142 INFO: checking COLLECT
  WARNING: The output directory &quot;C:\cheng\Project\STC_Tool\venv\dist\test&quot; and ALL ITS CONTENTS will be REMOVED! Continue? (y/N)y
  On your own risk, you can use the option `--noconfirm` to get rid of this question.
  2769 INFO: Removing dir C:\cheng\Project\STC_Tool\venv\dist\test
  2780 INFO: Building COLLECT COLLECT-00.toc
  2830 INFO: Building COLLECT COLLECT-00.toc completed successfully.
  </code></pre>
  <p>but the test.exe flashed and closed after I click , I using screen recording tool capture the flash error</p>
  <p>, it shows <code>Error loading Python DLL 'c:\cheng\Project\STC_Tool\venv\dist\test'</code></p>
  <p>the python installed on win10 is python3.7 , and I am using win10 64 bit operating system.</p>
  <p>could you please give me some suggestiones .</p>