mirror of
https://github.com/brentvollebregt/auto-py-to-exe.git
synced 2026-04-26 12:15:50 +03:00
[GH-ISSUE #160] When run auto-py-to-exe with --onefile option I get OSError: [WinError 5] Access is denied, and can not get my .exe file #150
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ScorpJ on GitHub (Mar 19, 2021).
Original GitHub issue: https://github.com/brentvollebregt/auto-py-to-exe/issues/160
Here is some log from the tool.I am not sure what happened and how can I get the right thing.Bellow is the log I got
Running auto-py-to-exe v2.8.0
Building directory: C:\Users\s1028125\AppData\Local\Temp\tmpxacebnay
Provided command: pyinstaller --noconfirm --onefile --windowed --log-level "CRITICAL" --debug "all" "C:/projects/python/BackCross2SpreadSheetGUI.py"
Recursion Limit is set to 5000
Executing: pyinstaller --noconfirm --onefile --windowed --log-level CRITICAL --debug all C:/projects/python/BackCross2SpreadSheetGUI.py --distpath C:\Users\s1028125\AppData\Local\Temp\tmpxacebnay\application --workpath C:\Users\s1028125\AppData\Local\Temp\tmpxacebnay\build --specpath C:\Users\s1028125\AppData\Local\Temp\tmpxacebnay
An error occurred while packaging
Traceback (most recent call last):
File "c:\myapps\anaconda3\lib\site-packages\win32ctypes\pywin32\pywintypes.py", line 35, in pywin32error
yield
File "c:\myapps\anaconda3\lib\site-packages\win32ctypes\pywin32\win32api.py", line 229, in EndUpdateResource
_resource._EndUpdateResource(handle, discard)
File "c:\myapps\anaconda3\lib\site-packages\win32ctypes\core\cffi_resource.py", line 123, in _EndUpdateResource
check_false(
File "c:\myapps\anaconda3\lib\site-packages\win32ctypes\core\cffi_util.py", line 81, in call
self._raise_error(function_name)
File "c:\myapps\anaconda3\lib\site-packages\win32ctypes\core\cffi_util.py", line 92, in _raise_error
raise exception
OSError: [WinError 5] Access is denied
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\myapps\anaconda3\lib\site-packages\auto_py_to_exe\packaging.py", line 131, in package
run_pyinstaller()
File "c:\myapps\anaconda3\lib\site-packages\PyInstaller_main_.py", line 114, in run
run_build(pyi_config, spec_file, **vars(args))
File "c:\myapps\anaconda3\lib\site-packages\PyInstaller_main_.py", line 65, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "c:\myapps\anaconda3\lib\site-packages\PyInstaller\building\build_main.py", line 725, in main
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
File "c:\myapps\anaconda3\lib\site-packages\PyInstaller\building\build_main.py", line 672, in build
exec(code, spec_namespace)
File "C:\Users\s1028125\AppData\Local\Temp\tmpxacebnay\BackCross2SpreadSheetGUI.spec", line 20, in
exe = EXE(pyz,
File "c:\myapps\anaconda3\lib\site-packages\PyInstaller\building\api.py", line 450, in init
self.postinit()
File "c:\myapps\anaconda3\lib\site-packages\PyInstaller\building\datastruct.py", line 160, in postinit
self.assemble()
File "c:\myapps\anaconda3\lib\site-packages\PyInstaller\building\api.py", line 602, in assemble
self.manifest.update_resources(tmpnm, [1])
File "c:\myapps\anaconda3\lib\site-packages\PyInstaller\utils\win32\winmanifest.py", line 949, in update_resources
UpdateManifestResourcesFromXML(dstpath,
File "c:\myapps\anaconda3\lib\site-packages\PyInstaller\utils\win32\winmanifest.py", line 1027, in UpdateManifestResourcesFromXML
winresource.UpdateResources(dstpath, xmlstr, RT_MANIFEST, names or [name],
File "c:\myapps\anaconda3\lib\site-packages\PyInstaller\utils\win32\winresource.py", line 205, in UpdateResources
win32api.EndUpdateResource(hdst, 0)
File "c:\myapps\anaconda3\lib\site-packages\win32ctypes\pywin32\win32api.py", line 229, in EndUpdateResource
_resource._EndUpdateResource(handle, discard)
File "c:\myapps\anaconda3\lib\contextlib.py", line 131, in exit
self.gen.throw(type, value, traceback)
File "c:\myapps\anaconda3\lib\site-packages\win32ctypes\pywin32\pywintypes.py", line 37, in pywin32error
raise error(exception.winerror, exception.function, exception.strerror)
win32ctypes.pywin32.pywintypes.error: (5, 'EndUpdateResource', 'Access is denied')
Project output will not be moved to output folder
Complete.
@ScorpJ commented on GitHub (Mar 19, 2021):
When changed to--onedir get beollow error when run the exe.
Failed to execute script pyiboot01_bootstarp.
Error: 'NoneType object has no attribute 'write'
@brentvollebregt commented on GitHub (Mar 19, 2021):
Have you tried giving the script elevated permissions? It is probably trying to access a file it is not allowed to.
@ScorpJ commented on GitHub (Mar 21, 2021):
Yes,even run as admin, it is still get the same erroe.
@brentvollebregt commented on GitHub (Mar 22, 2021):
Could you create a new Python virtual environment, install auto-py-to-exe and your dependencies and then try to run the tool from this virtual environment please?
@ScorpJ commented on GitHub (Mar 22, 2021):
it's ok on my personal labtop, but has issue on my work labtop.
@brentvollebregt commented on GitHub (Mar 22, 2021):
Unless you can identify the difference there is not much I can help with sorry
@ScorpJ commented on GitHub (Mar 23, 2021):
I close this issue since I can use pyinstaller directly .Thanks for your help, it's realy a good tools.
@brentvollebregt commented on GitHub (Mar 23, 2021):
Sorry, I am not sure what you mean? How did you fix your issue?
@ScorpJ commented on GitHub (Mar 23, 2021):
I did not fix the issue just find a workaround to use pyinstaller directlly.
@BB6560 commented on GitHub (Jul 18, 2022):
And what would that mysterious workaround of yours be? :)
The only workaround that solved the problem for me is moving the project's folder to another place. For example I moved it directly to D:\ and the error disappeared. I have no idea why, but I hope this helps someone.
@connorhess commented on GitHub (Jul 4, 2023):
this is still an issue, I got it on my work and personal laptop after compiling a few times, will try the work around.
@vrawat26 commented on GitHub (Jan 9, 2024):
just create new virtual enviornment and run autopy there