[英]Installing 32bit-python-3.4 in wine in 64bit Linux
我已经安装了运行良好的 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 稳定版 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 稳定版 64 位 Linux 发行版。 之后我再次尝试,这次python-3.4.0.msi安装得很好。 感谢大家的帮助。
在 wine 上安装 python 是非常有意义的。 - 跨平台开发 - 开发wine 下使用的脚本(windows 和wine 之间存在差异,需要解决,例如在注册表中) - 我们使用wine 替换一些windows 框,因为在许多情况下它更快
如果您创建了应该在 Windows 上运行的多处理多平台代码,我强烈建议在 Windows/wine 上进行测试,因为 Windows 是最有限的操作系统(我说的是:Windows 上没有分叉,Windows 上没有信号,函数并且类必须是可选择的以产生新的进程,等等...)
现在我在 Windows 上开发的大多数程序,并在 Linux / Osx 上并行测试它们(因为通常在那里它们很可能无论如何都会运行)
我在这里做了一个构建示例,它包含 bash 脚本,用于在您的 Ubuntu 机器上自动安装 Wine 和 Python:
https://github.com/bitranox/install_python_on_wine_and_travis
我已将本指南用于 3.4 和 3.5。 以下是您需要做的:
#1 Use Wine 2.4
apt install add-apt-repository
add-apt-repository ppa:wine/wine-builds
apt install --install-recommends winehq-devel
#2 Use winetricks (a newer one that what is available in the repo)
wget https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks
./winetricks -q win10
./winetricks vcrun2015
#3 run the installer
wine python-3.4.4.exe
来源: http : //realtechtalk.com/How_To_Install_python_34_35_and_up_on_Linux_with_wine_Working_Solution-2288-articles
这是一种可怕的方式。 Python 构建为portable
,这意味着您只需为您的 debian 安装 python(实际上 debian 附带了 python,但您可以安装更多版本的 python)。
如果您有某些特定原因使用 windows 版本, wine
不是一种方法。 更好(更简单)的方法是使用VirtualBox
并模拟整个窗口。 我什至不确定是否可以使用 wine 完全运行 python。
编辑:你能在wine中转到你的C
盘并找到你的python.exe文件在哪里吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.