简体   繁体   中英

Are the x86 Visual C++ libraries needed for x64 Python Wheels?

Are the x86 Visual C++ libraries ( vc_redist.x86.exe ) ever needed for running x64 Python Wheels with C/C++ extensions on Windows, or x64 Visual C++ libraries ( vc_redist.x64.exe ) are sufficient?

For instance the x64 Tensorflow Python Wheel does not need the x86 Visual C++ libraries:

tensorflow-1.10.0-cp36-cp36m-win_amd64.whl

But I don't know if it is true for every x64 Python Wheel. Maybe a Python Wheel can contain both x86 and x64 machine code.

I'd expect not, unless it was starting a separate process from a 32-bit executable. A 64-bit process can't execute 32-bit machine code, and most Python stuff just runs as part of the main Python process.

(Technically you could do something crazy in hand-written assembly language in a DLL or something: a far jump to a 32-bit code segment, but then it would have a hard time making system calls. I've never heard of anyone actually doing that, and it wouldn't let you automatically make use of 32-bit libraries anyway, so it's not even really relevant for this question.)

The use-case for starting a 32-bit process from a 64-bit Python process might be to use some 32-bit-only stuff, like legacy libraries or something. Otherwise it would just be silly to build a 32-bit instead of 64-bit executable if you were going to include a separate executable in the first place to go with your Python module.

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