簡體   English   中英

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

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM