2

I am trying to create a installer with pynsist for my python application, which uses PyQt4. I want to bundle the python installation, therefore, I have to use python 3.5, as pynsist supports bundling only for python 3.5. I used a fresh WinPython 3.5.1.1 installation where I installed all the necessary packages and test the installer in a freshly installed Windows 10 virtual box. For building the installer I use the WinPython 3.5.1.1 environment on my Windows 7 machine.

But when I start the installed application, I get an error when QtGui or QtCore is imported:

ImportError: DLL load failed: The specified module could not be found.

Most problems with this error I found in the internet are caused by python not being able to find the dll, but the QtGui4.dll file is present in the pkgs\PyQt4 folder and also copying it to the main folder of the application or the python folder doesn't change anything.

I also tried to export the example PyQt4 application in the pynsist repository with bundling and python 3.5.1 as a minimal example, but I get the same error.

Using the dependency walker in the Windows 10 environment on QtCore.pyd yield: enter image description here There are a lot more "API-MS-WIN*.DLL" dependencies missing, I just scrolled to the part where it seamed to be most "interesting".

4

1 回答 1

1

丢失的 dll 文件是msvcp140.dll.

通过将该文件放入该文件pynsist_pkgs旁边的目录中,可以将该文件包含在安装中.cfg

要在运行时加载它,pkgs必须将其添加到路径中。这可以使用extra_preamble包含以下内容的文件来完成:

os.environ['PATH'] = pkgdir + os.pathsep + os.environ.get('PATH', '')
于 2016-01-13T15:26:18.620 回答