New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows installer created with Python X.Y does not work with Python X.Y+1 #49168
Comments
The code causing this is: import socket and the actual error is: ImportError If the installer is created with Python 2.6.1, it works fine. The problem was noticed in the Robot Framework project and the issue can This problem was first asked as part of issue |
Was the 2.6 installation "for all users", or "just for me"? What Windows |
Python 2.6.1 was installed with option all users. I have admin rights |
Not sure if there is much to be done here; I don’t know if it is a reasonable expectation that an installer created with 2.X still work with 2.X+1, and anyway only 2.7 could get a bugfix now. |
Installers "ought to" work for subsequent versions if they contain pure-Python packages (i.e. no extension modules). I agree that the issue is obsolete for 2.x, but it may still exist for 3.x. |
Thanks, keeping it open. If I manage to get a VM set up I will see if this is reproducible. |
Can this be closed as history with so many changes having been made to the installer for 3.5? |
There haven't been any fundamental changes to bdist_wininst in years, and bdist_wheel has mostly replaced it nowadays. I'm fairly certain this issue was fixed by Mark Hammond's fix for bpo-4566. Just to be certain, I updated the code to use print as a function and used 3.4 to build "Simple-Python 3.4.3.win-amd64.exe". I installed this to 3.5, and the post-install script ran successfully. So I'm re-tagging this issue for versions 2.7 and 3.2 and closing it as a duplicate. In summary, Python built with VS 2008 needs an activation context for the CRT assembly, which is required to load msvcr90.dll. Normally this comes from the application executable, such as python.exe. But when Python is embedded, it may be the case that the application lacks the required activation context (e.g. a bdist_wininst installer created by Python 2.5). Mark Hammond's fix works around this problem by saving and reusing the activation context from when the Python DLL was loaded. This activation context is based on the DLL's resource #2 manifest, which includes the CRT assembly. One remaining problem for embedding Python 2.7 is accessing msvcr90.dll via ctypes. But it's ctypes! Just dynamically create an activation context. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: