-
Notifications
You must be signed in to change notification settings - Fork 3k
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
pip fails on windows due to interaction with pyinvoke on windows #8878
Comments
It looks like you have something running that is using pyyaml. Windows doesn't allow you to modify a loaded DLL, so pip can't reinstall pyyaml while the module is being used. I don't think invoke is relevant here, unless your actual invoke script is importing pyyaml (the test script you provide isn't, but that script doesn't fail for me). |
@pfmoore I have absolutely nothing using pyyaml, What you see is what I run. Also note that it does not always fail on pyyaml, and why would I get a failure on a temporary file? |
Hmm, maybe it's a virus checker opening the dll to check it? We unpack the wheel into a temporary location, then clean up when we're finished. If your virus checker aggressively opens the file to scan it and in doing so, locks the file so that pip can't clean up, that would result in the error you're seeing. If that's the case, this would be a duplicate of #7280 |
@pfmoore I tried to reproduce it by creating a completely new virtual env. I cannot reproduce it in that one. I have no idea what's going on to be honest, but I had this happening on two different windows machines. let me investigate a bit more. |
@pfmoore can now reproduce it again. Steps I used:
To me it does not look like antivirus. If it were antivirus, it would happen even when invoked from the command line. And it does seem to relate to the import of invoke. |
@pfmoore I am going to cross post this to pyinvoke, because I see they are doing some strange stuff with pyyaml... |
Yep, basically it looks like they import yaml (via a really funky route). So if you have pyyaml installed, importing invoke will lock it, so you can't upgrade it from a process that imports invoke. Good catch - I'd checked invoke's dependencies, but it doesn't declare pyyaml as a required dependency so I didn't spot it. Edit: in case it's not clear, pre-commit does depend on pyyaml, so that's what triggers the reinstall of pyyaml. |
@pfmoore I am rather sure at this point you are right and this is not a pip issue. Can be closed IMHO. However, it's really strange behavior and I'd love to understand why it accesses a pyd file that is temporary. Maybe some windows strangeness? Anyway. Closing. Thanks for the help. Please do not delete so that it can be referenced by pyinvoke bug tracker. |
Environment
invoke 1.4.1
Description
pip3 fails with
When invoked in a particular situation involving invoke. Note that the script is a minimalistic version that reproduces the error with as little noise as possible.
This is really strange and I believe might be a bug of invoke or an interaction of some sort. Note that I am not using any feature of invoke. I am just importing it.
The following script
Leads to the error
However, the pip3 install command executes successfully for the following:
I also checked the permissions of the (temporary) file that triggers the error, and there are no issues. It can be deleted without any issue.
Expected behavior
I would expect it to work :)
How to Reproduce
See description.
Output
See descripton.
The text was updated successfully, but these errors were encountered: