2

Installing python under wine generally means running a graphical installer, but I don't have that option, so instead I download Windows x86-64 embedded zip file from Python 3.6.0 and unpack it.

However, when I run wine python.exe I get errors:

wine: Call from 0x7b83c3ae to unimplemented function api-ms-win-crt-runtime-l1-1-0.dll._initialize_onexit_table, aborting
err:module:attach_process_dlls "python35.dll" failed to initialize, aborting
err:module:LdrInitializeThunk Main exe initialization for L"Z:\\<path>\\python.exe" failed, status 80000100

What can be done about it? Wine version is 1.8.

  • 1
    Is there a good reason why you don't want to use Linux version of python ? – Sergiy Kolodyazhnyy Jan 12 '17 at 8:40
2

Few users need to run Python under Wine, since Python works very well natively on all the systems that Wine works on. However, there are reasons to do it and it seems you have one (building a Windows installer with PyInstaller).

Some versions of Python certainly can run on some versions of Wine. Unfortunately, you've run into a combination that doesn't work.


What's happening

It looks like you're running into Bug #39437: "Visual Studio 2015-compiled C++ programs do not run".

The program you're running uses a function called _initialize_onexit_table from a library called api-ms-win-crt-runtime-l1-1-0.dll.

Wine provides its own version of api-ms-win-crt-runtime-l1-1-0.dll but it did not support the _initialize_onexit_table function until relatively recently (mid-2016). Wine 2.0 is the first Stable release that supports this function, although Development versions have supported it since 1.9.9.

Wine 2.0 will probably be released in the next couple of weeks, but release candidates are already available. Wine 2.0 was released a couple of weeks after this question was posted.

Can't upgrade Wine?

On a Windows computer, you'd be using Microsoft's version of that library. If you have a copy of Microsoft's version, you can configure Wine to use it instead of its builtin version.

You can use Wine's override system to achieve this (using winecfg or setting the WINEDLLPATH and WINEDLLOVERRIDES environment variables).

There is a project called Winetricks which can download Microsoft's libraries and configure your Wine to use them.

In conclusion

Upgrade your Wine version, or downgrade your Python version.

There are ways around it if you can't upgrade, but upgrading is probably your best option.

  • 2
    I'm building a Windows executable with pyInstaller in a venv, that's why I need to run python in wine. Anyway, updating to 2.0-rc4 helped. – Michael Ivko Jan 12 '17 at 10:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.