Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The file cannot be accessed by the system #141

Closed
captainsoccer opened this issue Nov 22, 2020 · 3 comments
Closed

The file cannot be accessed by the system #141

captainsoccer opened this issue Nov 22, 2020 · 3 comments

Comments

@captainsoccer
Copy link

hello i am a new user to this program, every time no matter what file i choose the same error shows up:
The file cannot be accessed by the system

@captainsoccer
Copy link
Author

this is what happens:
log.txt

@brentvollebregt
Copy link
Owner

For searchability and others that want to see the error:

Running auto-py-to-exe v2.7.8
Building directory: C:\Users\Eyal\AppData\Local\Temp\tmp8rjl49fz
Provided command: pyinstaller --noconfirm --onefile --windowed  "E:/downloads/iahte.py"
Recursion Limit is set to 5000
Executing: pyinstaller --noconfirm --onefile --windowed E:/downloads/iahte.py --distpath C:\Users\Eyal\AppData\Local\Temp\tmp8rjl49fz\application --workpath C:\Users\Eyal\AppData\Local\Temp\tmp8rjl49fz\build --specpath C:\Users\Eyal\AppData\Local\Temp\tmp8rjl49fz

168210 INFO: PyInstaller: 4.1
168224 INFO: Python: 3.8.6
168239 INFO: Platform: Windows-10-10.0.19041-SP0
168243 INFO: wrote C:\Users\Eyal\AppData\Local\Temp\tmp8rjl49fz\iahte.spec
168250 INFO: UPX is not available.
168256 INFO: Extending PYTHONPATH with paths
['E:\\downloads', 'C:\\Users\\Eyal\\AppData\\Local\\Temp\\tmp8rjl49fz']
168271 INFO: checking Analysis
168286 INFO: Building Analysis because Analysis-01.toc is non existent
168302 INFO: Reusing cached module dependency graph...
168356 INFO: Caching module graph hooks...
168412 INFO: running Analysis Analysis-01.toc
An error occurred while packaging
Traceback (most recent call last):
  File "C:\Users\Eyal\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\Eyal\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\Eyal\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\Eyal\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\Eyal\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:\Users\Eyal\Desktop\auto-py-to-exe-master\auto_py_to_exe\packaging.py", line 131, in package
    run_pyinstaller()
  File "C:\Users\Eyal\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\Eyal\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\Eyal\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\PyInstaller\building\build_main.py", line 720, in main
    build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
  File "C:\Users\Eyal\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\PyInstaller\building\build_main.py", line 667, in build
    exec(code, spec_namespace)
  File "C:\Users\Eyal\AppData\Local\Temp\tmp8rjl49fz\iahte.spec", line 6, in <module>
    a = Analysis(['E:/downloads/iahte.py'],
  File "C:\Users\Eyal\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\PyInstaller\building\build_main.py", line 242, in __init__
    self.__postinit__()
  File "C:\Users\Eyal\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\Eyal\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\PyInstaller\building\build_main.py", line 390, in assemble
    self.binaries.extend(bindepend.Dependencies([('', python, '')],
  File "C:\Users\Eyal\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\PyInstaller\depend\bindepend.py", line 224, in Dependencies
    for ftocnm, fn in getAssemblyFiles(pth, manifest, redirects):
  File "C:\Users\Eyal\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\PyInstaller\depend\bindepend.py", line 403, in getAssemblyFiles
    for assembly in getAssemblies(pth):
  File "C:\Users\Eyal\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\PyInstaller\depend\bindepend.py", line 354, in getAssemblies
    res = GetManifestResources(pth)
  File "C:\Users\Eyal\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\PyInstaller\utils\win32\winmanifest.py", line 1000, in GetManifestResources
    return winresource.GetResources(filename, [RT_MANIFEST], names, languages)
  File "C:\Users\Eyal\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\Eyal\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.1776.0_x64__qbz5n2kfra8p0\lib\contextlib.py", line 131, in __exit__
    self.gen.throw(type, value, traceback)
  File "C:\Users\Eyal\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')

Project output will not be moved to output folder
Complete.

@brentvollebregt
Copy link
Owner

brentvollebregt commented Nov 23, 2020

This looks like a pyinstaller error. Search for "win32ctypes.pywin32.pywintypes.error: (1920, 'LoadLibraryEx', 'The file cannot be accessed by the system')" in Google lead me to this comment on pyinstaller/pyinstaller#4941:

We don't support using python from the windows store when not using a virtual environment. Please use a virtual environment; that should fix this.

@brentvollebregt brentvollebregt changed the title program not working The file cannot be accessed by the system Nov 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants