简体   繁体   中英

Installing 32bit-python-3.4 in wine in 64bit Linux

I have installed 64bit Debian Stable Linux which is running very well:

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

I want to install 32bit python-3.4 in it (for XP Windows support also). I tried:

$ wine msiexec /i python-3.4.0.msi 

but got following error:

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

On trying to run it:

$ wine python

The error is:

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

How can I solve this problem? Thanks for your help.


Edit: This is obviously not ideal method to install Python for Windows, but it is very convenient since one can work in Linux to develop and test applications and then create executable files for Windows using pyinstaller in wine. This works very well in Debian Stable 32bit Linux.

Python is installed in ~/.wine/drive_c/python34 as follows:

$ 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

But on running py.exe:

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

Following also does not work:

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

Edit: As suggested by @laszlowaty in comments, I installed python34 (64bit) in Windows and copied the python34 folder to wine c_disk, but it does not work:

$ 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

I could not find python34.dll in Windows.


Edit: I had to do a reinstall of my Debian Stable 64bit Linux distribution. After this I again tried and python-3.4.0.msi installed perfectly well this time. Thanks everyone for your help.

it makes perfect sense to install python on wine. - cross platform development - development for scripts used under wine (there are differences between windows and wine that needs to be adressed, for instance in the registry) - we use wine to replace some windows boxes, because it is faster in many cases

And if You create multiprocessing multi-platform code that should run álso on Windows, I stongly recommend to test on windows/wine, because windows is the most limited os (I am talking about : no forking on Windows, no Signals on Windows, Functions and Classes must be pickable to spawn a new process, etc... )

Nowadays most Programs I develop on Windows, and test them parallel on Linux / Osx (because usually there they will most likely run anyway)

I made a build example here, it contains bash scripts to automatically install Wine and Python on Your Ubuntu machine :

https://github.com/bitranox/install_python_on_wine_and_travis

I have used this guide for 3.4 and 3.5. Here is what you need to do:

#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

Source: http://realtechtalk.com/How_To_Install_python_34_35_and_up_on_Linux_with_wine_Working_Solution-2288-articles

This is terrible way to do it. Python is build as portable , this means you can just install python for your debian (in fact there is python shipped with debian, but you can install more versions of python).

If you have some specific reason to use windows version, wine is not a way to go. Much better (and easier) way is to use VirtualBox and emulate whole windows. I am not even sure if it's possible to fully run python using wine.

edit: Can you go to your C drive in wine and find where is your python.exe file?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM