Hello, I am currently trying to build a standalone executable for a PyQt5 GUI application on a Windows 10 machine. The executable builds and runs fine on the machine on which it was built, but when I move the exe file to another windows machine and attempt to run it, I get the following error:
Error loading Python DLL
LoadLibrary: Access is denied.
The weird thing is I only receive this error when I try to run the exe file from certain directories. For example, I get this error if I run the exe from my Documents folder, but it runs just fine from the Desktop. However, when I sent the executable to a coworker, he received this error no matter where he ran it from.
Also, if I change the runtime tempdir to ‘.’ So the _MEI folder unpacks in the directory where the exe is located rather than the %temp% folder it works fine.
The machines that we use are enterprise machines with a lot of security measures, and we do not have administrator privileges, so that could be part of the problem, however once again on my machine the exe runs successfully from some directories which makes me think it may not be a permissions issue. I am building the executable with the following command:
pyinstaller --windowed --clean "PyFatigue.spec"
My .spec file is as follows:
# -*- mode: python -*-
site_packages = next(p for p in sys.path if 'site-packages' in p)
block_cipher = None
a = Analysis(['PyFatigue.py'],
for d in a.datas:
if '_C.cp37-win_amd64' in d:
pyz = PYZ(a.pure, a.zipped_data,
exe = EXE(pyz,