我已经安装了运行良好的64位Debian稳定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 32bit 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(64bit(,并将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这次安装得很好。感谢大家的帮助。
在葡萄酒上安装python是很有意义的。 - 跨平台开发 - 葡萄酒下使用的脚本的开发(窗户和葡萄酒之间存在差异,例如在注册表中( - 我们使用葡萄酒来更换一些Windows盒,因为它在许多情况下
都更快并且,如果您创建了应该在Windows上运行Álso的多平台代码,我会非常建议您在Windows/Wine上测试,因为Windows是最有限的OS(我在说:没有叉子,请在Windows上叉,没有信号Windows,功能和类必须可以挑剔才能产生新的过程,等等...(
如今,我在Windows上开发的大多数程序,并在Linux/OSX上并行测试它们(因为通常它们很可能会运行(
我在这里做了一个构建示例,它包含bash脚本以自动安装葡萄酒和python在您的Ubuntu机器上:
https://github.com/bitranox/install_python_on_wine_and_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_34_35_35_and_up_up_on_linux_with_wine_wine_wine_working_solate_solution-2288-Articles
这是可怕的方法。Python是portable
的构建,这意味着您可以为Debian安装Python(实际上,Python配备了Debian,但您可以安装更多版本的Python(。
如果您有一些使用Windows版本的特定理由,则wine
是不必要的。更好(更容易(的方法是使用VirtualBox
并模拟整个窗口。我什至不确定是否有可能使用葡萄酒充分运行Python。
编辑:您可以进入葡萄酒中的C
驱动器,然后找到您的python.exe文件在哪里?