How To Install python 3.4 3.5 and up on Linux with wine - Working Solution

This is sure simple if you follow the guide but it took a lot of hacking around to make this work on Debian/Ubuntu!
Now before you ask why bother running wine and python, the reason is because Python executables are NOT cross-platform.  If you run pyinstaller in Linux, that binary will only run on Linux and the same if you do it in Windows.  So it is preferable if you have a single environment that you can create Linux and Windows binaries from rather than running 2 separate ones.  The best way to do that is wine if you have the patience to make it work!

python 3.5 and up doesn't install properly in wine 2.4.  It doesn't even show the install button
#but it seems OK if you installed vcrun2015 and just click in the middle of the installer it seems to complete (if it doesn't complete and gives an error this is because you didn't install vcrun2015 with winetricks).

#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


#how to install like pip

wine python -m pip install pyinstaller

 


Some of the hacking around I did to figure this out: :)

 

err:module:import_dll Library api-ms-win-crt-runtime-l1-1-0.dll (which is needed by L"Z:\\root\\VCRUNTIME140.dll") not found
apt install winetricks
winetricks vcrun2015

winetricks vcrun2015
------------------------------------------------------
You are using a 64-bit WINEPREFIX. If you encounter problems, please retest in a clean 32-bit WINEPREFIX before reporting a bug.
------------------------------------------------------
Unknown arg vcrun2015
Usage: /usr/bin/winetricks [options] [command|verb|path-to-verb] ...
Executes given verbs.  Each verb installs an application or changes a setting.

##############


wget  https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks

bash winetricks vcrun2015
------------------------------------------------------
Running Wine/winetricks as root is highly discouraged. See https://wiki.winehq.org/FAQ#Should_I_run_Wine_as_root.3F
------------------------------------------------------
------------------------------------------------------
Your version of wine 1.6.2 is no longer supported upstream. You should upgrade to 4.x
------------------------------------------------------
^C^C------------------------------------------------------
WINEPREFIX INFO:
Drive C: total 24
drwxr-xr-x  6 root root 4096 Mar 25 00:29 .
drwxr-xr-x  4 root root 4096 Mar 25 14:56 ..
drwxr-xr-x  4 root root 4096 Mar 25 00:28 Program Files
drwxr-xr-x  4 root root 4096 Mar 25 00:29 Program Files (x86)
drwxr-xr-x  4 root root 4096 Mar 25 00:28 users
drwxr-xr-x 13 root root 4096 Mar 25 14:54 windows

Registry info:
/root/.wine/system.reg:#arch=win64
/root/.wine/user.reg:#arch=win64
/root/.wine/userdef.reg:#arch=win64
------------------------------------------------------
cat: /tmp/winetricks.82XQNcAN/early_wine.err.txt: No such file or directory
------------------------------------------------------
wine cmd.exe /c echo '%ProgramFiles%' returned empty string, error message ""
------------------------------------------------------




root@geekspython:~# bash winetricks vcrun2015
------------------------------------------------------
Running Wine/winetricks as root is highly discouraged. See https://wiki.winehq.org/FAQ#Should_I_run_Wine_as_root.3F
------------------------------------------------------
------------------------------------------------------
Your version of wine 1.6.2 is no longer supported upstream. You should upgrade to 4.x
------------------------------------------------------
------------------------------------------------------
You are using a 64-bit WINEPREFIX. Note that many verbs only install 32-bit versions of packages. If you encounter problems, please retest in a clean 32-bit WINEPREFIX before reporting a bug.
------------------------------------------------------
Using winetricks 20191224-next - sha256sum: 3a11b9c07e2d7f5b6c21a5e7ef35c70cbc9344bd9a8e068d74b34793dfee6484 with wine-1.6.2 and WINEARCH=win64
Executing w_do_call vcrun2015
------------------------------------------------------
You are using a 64-bit WINEPREFIX. Note that many verbs only install 32-bit versions of packages. If you encounter problems, please retest in a clean 32-bit WINEPREFIX before reporting a bug.
------------------------------------------------------
Executing load_vcrun2015
Executing mkdir -p /root/.cache/winetricks/vcrun2015
Executing cd /root/.cache/winetricks/vcrun2015
Downloading https://download.microsoft.com/download/9/3/F/93FCF1E7-E6A4-478B-96E7-D4B285925B00/vc_redist.x86.exe to /root/.cache/winetricks/vcrun2015
--2020-03-25 14:57:45--  https://download.microsoft.com/download/9/3/F/93FCF1E7-E6A4-478B-96E7-D4B285925B00/vc_redist.x86.exe
Resolving download.microsoft.com (download.microsoft.com)... 104.88.156.140, 2001:4958:304:288::e59, 2001:4958:304:290::e59
Connecting to download.microsoft.com (download.microsoft.com)|104.88.156.140|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 13767776 (13M) [application/octet-stream]
Saving to: 'vc_redist.x86.exe'

vc_redist.x86.exe                                           100%[=========================================================================================================================================>]  13.13M  11.2MB/s    in 1.2s   

2020-03-25 14:57:46 (11.2 MB/s) - 'vc_redist.x86.exe' saved [13767776/13767776]

Executing cd /root
------------------------------------------------------
Working around wine bug 37781
------------------------------------------------------
------------------------------------------------------
This may fail in non-XP mode, see https://bugs.winehq.org/show_bug.cgi?id=37781
------------------------------------------------------
Using native,builtin override for following DLLs: api-ms-win-crt-private-l1-1-0 api-ms-win-crt-conio-l1-1-0 api-ms-win-crt-heap-l1-1-0 api-ms-win-crt-locale-l1-1-0 api-ms-win-crt-math-l1-1-0 api-ms-win-crt-runtime-l1-1-0 api-ms-win-crt-stdio-l1-1-0 api-ms-win-crt-time-l1-1-0 atl140 concrt140 msvcp140 msvcr140 ucrtbase vcomp140 vcruntime140
Executing wine regedit C:\windows\Temp\override-dll.reg
Executing wine64 regedit C:\windows\Temp\override-dll.reg
ADD - HKLM\System\CurrentControlSet\Control\ProductOptions ProductType 0 (null) WinNT 1
The operation completed successfully
Setting Windows version to winxp
Executing wine regedit C:\windows\Temp\set-winver.reg
Executing wine64 regedit C:\windows\Temp\set-winver.reg
------------------------------------------------------
Running /usr/bin/wineserver -w. This will hang until all wine processes in prefix=/root/.wine terminate
------------------------------------------------------
Executing cd /root/.cache/winetricks/vcrun2015
Executing wine vc_redist.x86.exe
fixme:heap:HeapSetInformation (nil) 1 (nil) 0
fixme:heap:HeapSetInformation (nil) 1 (nil) 0
fixme:ntdll:NtQueryInformationToken QueryInformationToken( ..., TokenElevation, ...) semi-stub
err:ole:CoInitializeEx Attempt to change threading model of this apartment from multi-threaded to apartment threaded
fixme:heap:HeapSetInformation (nil) 1 (nil) 0
fixme:heap:HeapSetInformation (nil) 1 (nil) 0
fixme:ntdll:NtQueryInformationToken QueryInformationToken( ..., TokenElevation, ...) semi-stub
err:ole:CoInitializeEx Attempt to change threading model of this apartment from multi-threaded to apartment threaded
fixme:advapi:DecryptFileW (L"C:\\users\\root\\Temp\\{74d0e5db-b326-4dae-a6b2-445b9de1836e}\\", 00000000): stub


#

./winetricks vcrun2015
------------------------------------------------------
Running Wine/winetricks as root is highly discouraged. See https://wiki.winehq.org/FAQ#Should_I_run_Wine_as_root.3F
------------------------------------------------------
------------------------------------------------------
Your version of wine 1.6.2 is no longer supported upstream. You should upgrade to 4.x
------------------------------------------------------
------------------------------------------------------
You are using a 64-bit WINEPREFIX. Note that many verbs only install 32-bit versions of packages. If you encounter problems, please retest in a clean 32-bit WINEPREFIX before reporting a bug.
------------------------------------------------------
Using winetricks 20191224-next - sha256sum: 3a11b9c07e2d7f5b6c21a5e7ef35c70cbc9344bd9a8e068d74b34793dfee6484 with wine-1.6.2 and WINEARCH=win64
Executing w_do_call vcrun2015
------------------------------------------------------
You are using a 64-bit WINEPREFIX. Note that many verbs only install 32-bit versions of packages. If you encounter problems, please retest in a clean 32-bit WINEPREFIX before reporting a bug.
------------------------------------------------------
Executing load_vcrun2015
------------------------------------------------------
Working around wine bug 37781
------------------------------------------------------
------------------------------------------------------
This may fail in non-XP mode, see https://bugs.winehq.org/show_bug.cgi?id=37781
------------------------------------------------------
Using native,builtin override for following DLLs: api-ms-win-crt-private-l1-1-0 api-ms-win-crt-conio-l1-1-0 api-ms-win-crt-heap-l1-1-0 api-ms-win-crt-locale-l1-1-0 api-ms-win-crt-math-l1-1-0 api-ms-win-crt-runtime-l1-1-0 api-ms-win-crt-stdio-l1-1-0 api-ms-win-crt-time-l1-1-0 atl140 concrt140 msvcp140 msvcr140 ucrtbase vcomp140 vcruntime140
Executing wine regedit C:\windows\Temp\override-dll.reg
Executing wine64 regedit C:\windows\Temp\override-dll.reg
ADD - HKLM\System\CurrentControlSet\Control\ProductOptions ProductType 0 (null) WinNT 1
The operation completed successfully
Setting Windows version to winxp
Executing wine regedit C:\windows\Temp\set-winver.reg
Executing wine64 regedit C:\windows\Temp\set-winver.reg
------------------------------------------------------
Running /usr/bin/wineserver -w. This will hang until all wine processes in prefix=/root/.wine terminate
------------------------------------------------------
Executing cd /root/.cache/winetricks/vcrun2015
Executing wine vc_redist.x86.exe
fixme:heap:HeapSetInformation (nil) 1 (nil) 0
fixme:heap:HeapSetInformation (nil) 1 (nil) 0
fixme:ntdll:NtQueryInformationToken QueryInformationToken( ..., TokenElevation, ...) semi-stub
err:ole:CoInitializeEx Attempt to change threading model of this apartment from multi-threaded to apartment threaded
fixme:heap:HeapSetInformation (nil) 1 (nil) 0
fixme:heap:HeapSetInformation (nil) 1 (nil) 0
fixme:ntdll:NtQueryInformationToken QueryInformationToken( ..., TokenElevation, ...) semi-stub
err:ole:CoInitializeEx Attempt to change threading model of this apartment from multi-threaded to apartment threaded
fixme:advapi:DecryptFileW (L"C:\\users\\root\\Temp\\{74d0e5db-b326-4dae-a6b2-445b9de1836e}\\", 00000000): stub
------------------------------------------------------
Note: command wine vc_redist.x86.exe returned status 109. Aborting.
------------------------------------------------------


WINEPREFIX=$HOME/.wine-msxml-test WINEARCH=win32 ./winetricks -q vcrun2015


apt install software-properties-common
add-apt-repository ppa:wine/wine-builds
apt update
apt install --install-recommends winehq-devel

WINEPREFIX=$HOME/.wine-msxml-test WINEARCH=win32 ./winetricks -q vcrun2015
------------------------------------------------------
Running Wine/winetricks as root is highly discouraged. See https://wiki.winehq.org/FAQ#Should_I_run_Wine_as_root.3F
------------------------------------------------------
------------------------------------------------------
Your version of wine 2.4 is no longer supported upstream. You should upgrade to 4.x
------------------------------------------------------
Using winetricks 20191224-next - sha256sum: 3a11b9c07e2d7f5b6c21a5e7ef35c70cbc9344bd9a8e068d74b34793dfee6484 with wine-2.4 and WINEARCH=win32
Executing w_do_call vcrun2015
Executing load_vcrun2015
------------------------------------------------------
Working around wine bug 37781
------------------------------------------------------
------------------------------------------------------
This may fail in non-XP mode, see https://bugs.winehq.org/show_bug.cgi?id=37781
------------------------------------------------------
Using native,builtin override for following DLLs: api-ms-win-crt-private-l1-1-0 api-ms-win-crt-conio-l1-1-0 api-ms-win-crt-heap-l1-1-0 api-ms-win-crt-locale-l1-1-0 api-ms-win-crt-math-l1-1-0 api-ms-win-crt-runtime-l1-1-0 api-ms-win-crt-stdio-l1-1-0 api-ms-win-crt-time-l1-1-0 atl140 concrt140 msvcp140 msvcr140 ucrtbase vcomp140 vcruntime140
Executing wine regedit /S C:\windows\Temp\override-dll.reg
Setting Windows version to winxp
Executing wine regedit /S C:\windows\Temp\set-winver.reg
------------------------------------------------------
Running /usr/bin/wineserver -w. This will hang until all wine processes in prefix=/root/.wine-msxml-test terminate
------------------------------------------------------
Executing cd /root/.cache/winetricks/vcrun2015
Executing wine vc_redist.x86.exe /q
fixme:heap:RtlSetHeapInformation (nil) 1 (nil) 0 stub
fixme:heap:RtlSetHeapInformation (nil) 1 (nil) 0 stub
fixme:ntdll:NtQueryInformationToken QueryInformationToken( ..., TokenElevation, ...) semi-stub
err:ole:CoInitializeEx Attempt to change threading model of this apartment from multi-threaded to apartment threaded
fixme:heap:RtlSetHeapInformation (nil) 1 (nil) 0 stub
fixme:heap:RtlSetHeapInformation (nil) 1 (nil) 0 stub
fixme:ntdll:NtQueryInformationToken QueryInformationToken( ..., TokenElevation, ...) semi-stub
err:ole:CoInitializeEx Attempt to change threading model of this apartment from multi-threaded to apartment threaded
fixme:advapi:DecryptFileW (L"C:\\users\\root\\Temp\\{74d0e5db-b326-4dae-a6b2-445b9de1836e}\\", 00000000): stub
fixme:shell:SHAutoComplete stub
fixme:advapi:DecryptFileW (L"C:\\users\\root\\Temp\\{74d0e5db-b326-4dae-a6b2-445b9de1836e}\\", 00000000): stub
fixme:wuapi:automatic_updates_Pause
fixme:ntdll:NtLockFile I/O completion on lock not implemented yet
fixme:wuapi:automatic_updates_Resume


wine python.exe -m pip install pyinstaller
fixme:module:load_library unsupported flag(s) used (flags: 0x00000800)
fixme:module:load_library unsupported flag(s) used (flags: 0x00000800)
fixme:module:load_library unsupported flag(s) used (flags: 0x00000800)
fixme:ntdll:EtwEventRegister ({5eec90ab-c022-44b2-a5dd-fd716a222a15}, 0x100027f0, 0x10010030, 0x10010048) stub.
fixme:ntdll:EtwEventSetInformation (deadbeef, 2, 0x10002560, 43) stub
fixme:msvcrt:_configure_wide_argv (1) stub
fixme:msvcrt:_initialize_wide_environment stub
Z:\root\python.exe: No module named pip
fixme:ntdll:EtwEventUnregister (deadbeef) stub.


wget https://www.python.org/ftp/python/3.5.1/python-3.5.1.exe


apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ xenial main'
apt install winehq-devel






actually python3.4.4. works

wine pyinstaller
fixme:heap:RtlSetHeapInformation (nil) 1 (nil) 0 stub
PyInstaller requires at least Python 2.7 or 3.5+.
 


Tags:

install, python, linux, solutionthis, hacking, debian, ubuntu, executables, platform, pyinstaller, binary, preferable, binaries, doesn, ok, installed, vcrun, installer, didn, winetricks, apt, repository, ppa, builds, recommends, winehq, devel, newer, repo, wget, https, githubusercontent, src, pip, err, module, import_dll, api, crt, runtime, dll, quot, z, vcruntime, wineprefix, encounter, retest, reporting, arg, usage, usr, bin, verb, executes, verbs, installs, bash, discouraged, wiki, org, faq, should_i_run_wine_as_root, supported, upstream, upgrade, info, drwxr, xr, mar, users, registry, reg, user, userdef, tmp, xqncan, early_wine, txt, directory, cmd, exe, echo, programfiles, geekspython, versions, packages, sha, sum, ef, cbc, bd, dfee, winearch, executing, w_do_call, load_vcrun, mkdir, cache, downloading, download, microsoft, fcf, vc_redist, resolving, connecting, http, awaiting, length, octet, stream, mb, xp, mode, show_bug, cgi, native, builtin, override, dlls, conio, heap, locale, stdio, atl, concrt, msvcp, msvcr, ucrtbase, vcomp, regedit, temp, hklm, currentcontrolset, productoptions, producttype, null, winnt, completed, successfully, winxp, winver, wineserver, processes, prefix, terminate, fixme, heapsetinformation, nil, ntdll, ntqueryinformationtoken, queryinformationtoken, tokenelevation, semi, stub, ole, coinitializeex, threading, multi, threaded, advapi, decryptfilew, db, dae, aborting, msxml, software, properties, update, rtlsetheapinformation, shell, shautocomplete, wuapi, automatic_updates_pause, ntlockfile, completion, implemented, automatic_updates_resume, load_library, unsupported, flags, etweventregister, eec, ab, dd, fd, etweventsetinformation, deadbeef, msvcrt, _configure_wide_argv, _initialize_wide_environment, etweventunregister, www, ftp, deb, dl, xenial, requires,

Latest Articles

  • Huion and Wacom Tablets How To Install in Linux Mint / Ubuntu and make the stylus work properly
  • ffmpeg how to cut certain parts of video out
  • ffmpeg how to concat and join two video clips
  • mencoder instead of ffmpeg to join or concatenate video files with different audio streams
  • Linux How To Stop Missing Drive from Halting Boot Process in fstab
  • How To Replace Audio Track of Video using ffmpeg
  • qemu-img convert formats vdi vmdk raw qcow2
  • Linux and Windows Dual Boot Crazy Time Issues
  • dynagen / dynamips 100% high CPU usage solution - how to set the idlepc value
  • How To Setup a Cisco CME (Cisco Manager Express) Virtual Router under Linux using dynamips and dynagen
  • Linux Mint Ubuntu Debian CentOS Dual Boot Install Issues
  • Linux Mint Ubuntu Debian Centos RHEL no sound solution
  • Linux Mint/Debian/Ubuntu/Centos Installer black grub screen and blank screen after trying to boot installer or main OS
  • Linux Mint Dual Boot Install Avoid Wiping our your Main C: drive /dev/sda MBR and EFI
  • QEMU-KVM soundhw deprecated how to enable sound in QEMU 4.x series
  • Virtualbox Error Cannot register the hard disk because a hard disk with UUID already exists solution
  • kernel: [549267.368859] mate-terminal[7871]: segfault at 2000000101 ip 00007f5d0a9548f0 sp 00007fff7012c610 error 4 in libgobject-2.0.so.0.4800.2[7f5d0a920000+52000]
  • apcupsd how to setup and monitor APC UPS units
  • How To Password Reset, Recover, Bypass, Remove and Unlock on Windows 10,8,7,Vista,XP,NT,2000,2003,2008,2012,2016,2019 Administrative Login Programs
  • Nvidia Ubuntu Linux Screentearing Video with solution driver