Skip to content
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

pywinpty: winpty.dll loading issue. #161

Open
nikhil-mohite opened this issue Jun 11, 2021 · 8 comments
Open

pywinpty: winpty.dll loading issue. #161

nikhil-mohite opened this issue Jun 11, 2021 · 8 comments
Assignees
Labels
Milestone

Comments

@nikhil-mohite
Copy link

nikhil-mohite commented Jun 11, 2021

Hi Team,

I am using pywinpty to create pseudoterminal, It is working fine with Windows 10 version 1809 and above. but it is falling for versions below 1809.
Getting the error: "Exception in import winpty DLL load failed while importing winpty: The specified procedure could not be found.".

As we know Windows 10 version 1809 added support for ConPty so it is working with it, but if ConPty is not available or not present it should select WinPty API but get the above-mentioned error.
I also tried to set WinPty as a backend by sending backend=1 or setting the 'PYWINPTY_BACKEND' variable to value 1.
It is falling on import PtyProcess, PFA

winpty_dll_issue

If you require any other information please let me know.

@andfoy
Copy link
Owner

andfoy commented Jun 22, 2021

Hi @nikhil-mohite, this is indeed an issue with machines where the CreatePseudoConsole call is not available. Right now we are linking directly to system32, and the library switching is not working as expected, we most probably should apply dynamic loading here.

@andfoy andfoy self-assigned this Jun 22, 2021
@andfoy andfoy added this to the v1.2.0 milestone Jun 24, 2021
@dragoljub
Copy link

I'm running into the same issue. Is there any way to install ConPty or do you have to wait for the new windows version?

@andfoy
Copy link
Owner

andfoy commented Aug 11, 2021

I think you can install the latest Windows 10 SDK: https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk/

@dragoljub
Copy link

Thanks! I'll give this a shot. For now I just downgraded to the older version of pywinpty and terminado which seemed to work.

@yxiao315
Copy link

winpty.dll can load on Local PC for Windows 10, but failed on Window Server 2016, any solution?

@yxiao315
Copy link

@andfoy And Install Windows 10 SDK on Windows Server 2016 not solve the problem

@andfoy
Copy link
Owner

andfoy commented Dec 16, 2022

According to https://learn.microsoft.com/en-us/windows/console/createpseudoconsole, ConPTY requires at least Windows Server 2019. Since I haven't been able to implement the dynamic loading on winpty-rs (the backend library used by pywinpty), the only sensible option is to recompile the library in the target system

@yxiao315
Copy link

@andfoy thanks so much for quick replying, that saves my time to further search on google. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants