python - 在 64 位 Linux 的 wine 中安装 32bit-python-3.4

标签 python linux wine

我已经安装了运行良好的 64 位 Debian Stable Linux:

Linux debian 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2+deb9u5 (2017-09-19) x86_64 GNU/Linux

我想在其中安装 32 位 python-3.4(也支持 XP Windows)。我试过:

$ wine msiexec /i python-3.4.0.msi 

但出现以下错误:

err:mscoree:LoadLibraryShim error reading registry key for installroot
err:mscoree:LoadLibraryShim error reading registry key for installroot
err:mscoree:LoadLibraryShim error reading registry key for installroot
err:mscoree:LoadLibraryShim error reading registry key for installroot
err:module:import_dll Loading library python34.dll (which is needed by L"C:\\python34\\python.exe") failed (error c000007b).
err:module:LdrInitializeThunk Main exe initialization for L"C:\\python34\\python.exe" failed, status c0000135
err:msi:ITERATE_Actions Execution halted, action L"UpdatePip" returned 1627
err:msi:ITERATE_Actions Execution halted, action L"ExecuteAction" returned 1627

尝试运行它:

$ wine python

错误是:

wine: cannot find L"C:\\windows\\system32\\python.exe"

我该如何解决这个问题?感谢您的帮助。


编辑:这显然不是为 Windows 安装 Python 的理想方法,但它非常方便,因为可以在 Linux 中开发和测试应用程序,然后使用 wine 中的 pyinstaller 创建适用于 Windows 的可执行文件。这在 Debian Stable 32 位 Linux 中运行良好。

Python安装在~/.wine/drive_c/python34如下:

$ ls -l
total 4168
drwxr-xr-x 34 cardio cardio    4096 Feb 13 15:10 Lib
-rwxr-xr-x  1 cardio cardio  102400 Mar 16  2014 py.exe
-rw-r--r--  1 cardio cardio 4044800 Mar 16  2014 python34.dll
-rwxr-xr-x  1 cardio cardio  102912 Mar 16  2014 pyw.exe
drwxr-xr-x  2 cardio cardio    4096 Feb 12 08:23 Scripts
drwxr-xr-x  5 cardio cardio    4096 Feb 11 23:10 Tools

但是在运行 py.exe 时:

$ wine ./py.exe 
Can't find a default Python.

以下也不起作用:

$ wine python34.exe
wine: cannot find L"C:\\windows\\system32\\python34.exe"

编辑:正如@laszlowaty 在评论中所建议的,我在 Windows 中安装了 python34(64 位)并将 python34 文件夹复制到 wine c_disk,但它不起作用:

$ wine ./python.exe
err:module:import_dll Library python34.dll (which is needed by L"C:\\Python34\\python.exe") not found
err:module:LdrInitializeThunk Main exe initialization for L"C:\\Python34\\python.exe" failed, status c0000135

我在 Windows 中找不到 python34.dll。


编辑:我不得不重新安装我的 Debian Stable 64 位 Linux 发行版。在此之后我再次尝试并且这次 python-3.4.0.msi 安装得非常好。感谢大家的帮助。

最佳答案

在 wine 上安装 python 非常有意义。 - 跨平台开发 - 开发 wine 下使用的脚本(需要解决 windows 和 wine 之间的差异,例如在注册表中) - 我们使用 wine 来替换一些窗口框,因为它在很多情况下更快

如果您创建的多处理多平台代码也应该在 Windows 上运行,我强烈建议在 windows/wine 上进行测试,因为 windows 是最受限制的操作系统(我说的是:在 Windows 上没有 fork ,没有 Signals on Windows、Functions 和 Classes 必须是可拾取的以生成新进程等...)

现在我在 Windows 上开发的大多数程序,并在 Linux/Osx 上并行测试它们(因为通常它们很可能无论如何都会运行)

我在这里做了一个构建示例,它包含 bash 脚本,可以在你的 Ubuntu 机器上自动安装 Wine 和 Python:

https://github.com/bitranox/install_python_on_wine_and_travis

关于python - 在 64 位 Linux 的 wine 中安装 32bit-python-3.4,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48763750/

相关文章:

delphi - 在 Wine 上调试 Delphi 应用程序

python - 如何从列表中的键获取字典值?

python - 指数退避 : time. sleep with random.randint(0, 1000)/1000

python - 这个函数调用是如何工作的? (涉及到多对括号和装饰器)

linux - 将符号限制为 Linux 可执行文件的本地范围

c - 我在这个非常基本的 C 代码中得到一个 "Error: Can' t Open Display,但我不明白为什么

php - 如何在apache中重定向php文件

bash - OSX 将 shell 脚本与文件扩展名相关联?

Wine 下的 Python 到 Windows 可执行文件

python - 如何在不使用 Pandas 的情况下将 Numpy 转换为 Parquet?