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

Can't install package (could not open 'PyInstaller\bootloader\Windows-32bit\runw.exe': Invalid argument error) #3813

Closed
TilmanK opened this issue Oct 18, 2018 · 3 comments

Comments

@TilmanK
Copy link

@TilmanK TilmanK commented Oct 18, 2018

I had a problem yesterday when the IT deparment reactivated some group policies on my Windows client, that deny running executibles from some folder (i.e. user folder where my pyCharm projects are located). I removed them, with no success as usual. At some point I tried to reinstall pyinstaller but I'm always running into the same error (see below).

I tried this on a fresh installation of 32bit 3.7.0 python and also on 64bit 3.7.1rc1 python. Same problem with my existing 3.6 version. Also, this occurs with the latest development version.

I tried installing the package also from an elevated shell, with the same result. I also deactivated my anti-virus protection...

I honestly don't believe, that this is a bug within pyinstaller's setup script, nevertheless can be wrong on this. Can somebody check, if this is a problem within pyinstaller or, if not, provide some help on how to get things working again?

I attached a console log below. Thanks for the help!

Tilman

Pip verbose output: https://pastebin.com/A0LjEK4D

Installation fails here:
copying PyInstaller\bootloader\Windows-32bit\run.exe -> build\lib\PyInstaller\bootloader\Windows-32bit
copying PyInstaller\bootloader\Windows-32bit\run_d.exe -> build\lib\PyInstaller\bootloader\Windows-32bit
copying PyInstaller\bootloader\Windows-32bit\runw.exe -> build\lib\PyInstaller\bootloader\Windows-32bit
error: could not open 'PyInstaller\bootloader\Windows-32bit\runw.exe': Invalid argument
error

@htgoebel

This comment has been minimized.

Copy link
Member

@htgoebel htgoebel commented Oct 19, 2018

This looks like an error in setuptools or pip. Unfortunately the trace does not say more then "Invalid argument".
As you can seen after line 1139 , pip simply runs python setup.py install --record ... --single-v, ersion-externally-managed --compile` which then fails. There is not special handling for Windows-32bit\runw.exe in PyInstaller. Thus I'm afraid, I ca not help here.

@pwuertz

This comment has been minimized.

Copy link
Contributor

@pwuertz pwuertz commented Jan 16, 2020

I'm seeing the exact same thing in a new docker based install.

After an initial checkout, python setup.py build fails,

error: could not open 'PyInstaller\bootloader\Windows-32bit\runw.exe': Invalid argument

The runw.exe file is in a "strange" state now. Git says its modified, but I can't restore or reset it. Git diff yields the same file system error showing up while building PyInstaller:

PS C:\build\pyinstaller> git status
Not currently on any branch.
Changes not staged for commit:
  (use "git restore <file>..." to discard changes in working directory)
        modified:   PyInstaller/bootloader/Windows-32bit/runw.exe
PS C:\build\pyinstaller> git diff
error: open("PyInstaller/bootloader/Windows-32bit/runw.exe"): Invalid argument
fatal: cannot hash PyInstaller/bootloader/Windows-32bit/runw.exe

After waiting? or running setup build a few times, the file eventually disappears:

PS C:\build\pyinstaller> git status
Not currently on any branch.
Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        deleted:    PyInstaller/bootloader/Windows-32bit/runw.exe

If the file is deleted, i.e. not there, setup build finally succeeds.

I haven't looked into the PyInstaller build process. Is the deletion of files in the source distribution during the build by design or is this an accident? If it is by design.. there seems to be some kind of race condition related to the deletion of runw.exe, like a background process blocking the file for some time before finally deleting it..

@pwuertz

This comment has been minimized.

Copy link
Contributor

@pwuertz pwuertz commented Jan 16, 2020

Found the reason. Windows Defender is messing with that file:
PyInstaller_Trojan

Other virus scanners seem to pick it up too (also reported here #4633)

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

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.