-
Notifications
You must be signed in to change notification settings - Fork 23
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
wexpect fails in venv #26
Comments
The root-casue will be around process launching. Host's |
This is the root cause. |
The process pid is differs from the host and the child's point of view. See #26 for more details. This, random generated pipe_file_name, whill solve this issue.
This fix in dev branch seems to work well. Any chance of a new release? |
It looks like this Issue has also turned into a problem for virtualenv... I ran into a situation where wexpect programs that worked well on a system with an older virtualenv environment do NOT work on systems with newer virtualenv environments. In the newer virtualenv environments, wexpect programs always fail with the same pywintypes.error that says 'The system cannot find the file specified.' After some debugging, I discovered that wexpect programs still work correctly on all my systems if virtualenv is not used. (But this is not very desirable for me.) Looking at the virtualenv changelog, I found a note on Release 20.0.34 that says "Align with venv module when creating virtual environments with builtin creator on Windows 3.7 and later"; I'm thinking this means that starting with virtualenv 20.0.34, wexpect no longer works in virtualenv environments, because they'll have the same problem as venv environments. My current work-around is to simply use virtualenv 20.0.30 for all my wexpect programs. It's not the latest version of virtualenv, but it seems to allow my wexpect programs to continue to work on all my systems, at least for now. |
Thank this comment, The 850eece shows a way to solve this issue in all virtualenv. This implementation does not uses the child process' pid to identify the pip. |
The 850eece worked for me, thanks! If anyone needs help, you can use the following cmd inside an activated venv to install the fix:
|
Please release this! |
@jgentil I think the package development is completely dead. My conclusion with this is that it does not always work as if you run multi or single user Python install it still breaks. I think the conclusion was with Python multi user install if you don't run cmd in admin it will install packages in AppData because of write permissions to C:/Program files so therefore it will create 2 Python locations which breaks it. It sucks as I have some CLI things to test on Windows. |
Describe the bug
Wexpect cannot run inside venv. (Note wexpect works inside virtualenv)
To Reproduce
Create...:
python -m venv myvenv
...and activate venv
myvenv\Scripts\activate
Install wexpect:
python -m pip install wexpect
Run any of from wexpect examples:
python examples\hello_wexpect.py
Expected behavior
Not to crash with
EOF
Environment:
The text was updated successfully, but these errors were encountered: