I've run into that error a number of times, but it always seems to happen 
when I'm running through the "git bash shell" rather than the system 
command prompt. Using a standard command prompt (not running as 
administrator) generally seems to work for me. Also, PyInstaller works fine 
with Python 3.8 in my experience.

On Monday, May 4, 2020 at 11:36:43 PM UTC-8, Jacovb wrote:
>
> Im trying to use pyinstaller to turn a .py file into a .exe file, whenever 
> I run it I get this:
>
> 104 INFO: PyInstaller: 3.6
> 105 INFO: Python: 3.8.2
> 105 INFO: Platform: Windows-10-10.0.18362-SP0
> 108 INFO: wrote C:\Users\jsimp\Desktop\pain\disable.spec
> 111 INFO: UPX is not available.
> 113 INFO: Extending PYTHONPATH with paths
> ['C:\\Users\\jsimp\\Desktop\\pain', 'C:\\Users\\jsimp\\Desktop\\pain']
> 113 INFO: checking Analysis
> 113 INFO: Building Analysis because Analysis-00.toc is non existent
> 114 INFO: Initializing module dependency graph...
> 118 INFO: Caching module graph hooks...
> 128 INFO: Analyzing base_library.zip ...
> 3565 INFO: Processing pre-find module path hook   distutils
> 3566 INFO: distutils: retargeting to non-venv dir 'C:\\Program 
> Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\\lib'
> 5793 INFO: Caching module dependency graph...
> 5956 INFO: running Analysis Analysis-00.toc
> Traceback (most recent call last):
>   File 
> "C:\Users\jsimp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\win32ctypes\pywin32\pywintypes.py",
>  
> line 35, in pywin32error
>     yield
>   File 
> "C:\Users\jsimp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\win32ctypes\pywin32\win32api.py",
>  
> line 43, in LoadLibraryEx
>     return _dll._LoadLibraryEx(fileName, 0, flags)
>   File 
> "C:\Users\jsimp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\win32ctypes\core\cffi\_dll.py",
>  
> line 23, in _LoadLibraryEx
>     result = check_null(
>   File 
> "C:\Users\jsimp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\win32ctypes\core\cffi\_util.py",
>  
> line 81, in __call__
>     self._raise_error(function_name)
>   File 
> "C:\Users\jsimp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\win32ctypes\core\cffi\_util.py",
>  
> line 92, in _raise_error
>     raise exception
> OSError: [WinError 1920] The file cannot be accessed by the system
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
>   File "C:\Program 
> Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\lib\runpy.py",
>  
> line 193, in _run_module_as_main
>     return _run_code(code, main_globals, None,
>   File "C:\Program 
> Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\lib\runpy.py",
>  
> line 86, in _run_code
>     exec(code, run_globals)
>   File 
> "C:\Users\jsimp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\Scripts\pyinstaller.exe\__main__.py",
>  
> line 7, in <module>
>   File 
> "C:\Users\jsimp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\PyInstaller\__main__.py",
>  
> line 114, in run
>     run_build(pyi_config, spec_file, **vars(args))
>   File 
> "C:\Users\jsimp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\PyInstaller\__main__.py",
>  
> line 65, in run_build
>     PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
>   File 
> "C:\Users\jsimp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\PyInstaller\building\build_main.py",
>  
> line 734, in main
>     build(specfile, kw.get('distpath'), kw.get('workpath'), 
> kw.get('clean_build'))
>   File 
> "C:\Users\jsimp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\PyInstaller\building\build_main.py",
>  
> line 681, in build
>     exec(code, spec_namespace)
>   File "C:\Users\jsimp\Desktop\pain\disable.spec", line 6, in <module>
>     a = Analysis(['disable.py'],
>   File 
> "C:\Users\jsimp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\PyInstaller\building\build_main.py",
>  
> line 244, in __init__
>     self.__postinit__()
>   File 
> "C:\Users\jsimp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\PyInstaller\building\datastruct.py",
>  
> line 160, in __postinit__
>     self.assemble()
>   File 
> "C:\Users\jsimp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\PyInstaller\building\build_main.py",
>  
> line 393, in assemble
>     self.binaries.extend(bindepend.Dependencies([('', python, '')],
>   File 
> "C:\Users\jsimp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\PyInstaller\depend\bindepend.py",
>  
> line 228, in Dependencies
>     for ftocnm, fn in getAssemblyFiles(pth, manifest, redirects):
>   File 
> "C:\Users\jsimp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\PyInstaller\depend\bindepend.py",
>  
> line 404, in getAssemblyFiles
>     for assembly in getAssemblies(pth):
>   File 
> "C:\Users\jsimp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\PyInstaller\depend\bindepend.py",
>  
> line 355, in getAssemblies
>     res = GetManifestResources(pth)
>   File 
> "C:\Users\jsimp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\PyInstaller\utils\win32\winmanifest.py",
>  
> line 1007, in GetManifestResources
>     return winresource.GetResources(filename, [RT_MANIFEST], names, 
> languages)
>   File 
> "C:\Users\jsimp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\PyInstaller\utils\win32\winresource.py",
>  
> line 170, in GetResources
>     hsrc = win32api.LoadLibraryEx(filename, 0, LOAD_LIBRARY_AS_DATAFILE)
>   File 
> "C:\Users\jsimp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\win32ctypes\pywin32\win32api.py",
>  
> line 43, in LoadLibraryEx
>     return _dll._LoadLibraryEx(fileName, 0, flags)
>   File "C:\Program 
> Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.752.0_x64__qbz5n2kfra8p0\lib\contextlib.py",
>  
> line 131, in __exit__
>     self.gen.throw(type, value, traceback)
>   File 
> "C:\Users\jsimp\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\win32ctypes\pywin32\pywintypes.py",
>  
> line 37, in pywin32error
>     raise error(exception.winerror, exception.function, exception.strerror)
> win32ctypes.pywin32.pywintypes.error: (1920, 'LoadLibraryEx', 'The file 
> cannot be accessed by the system')
>
> I have tried running it as an admin in command prompt to no avail. Does 
> anyone know a fix for this?
>

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/84cdda5d-f677-4b9b-a9d0-6ea22f570b36%40googlegroups.com.

Reply via email to