pip install pyinstaller error OSError: [Errno 22] Invalid argument
1. Problem description
When using pip to install pyinstaller, an error is reported:
ERROR: Could not install packages due to an OSError: [Errno 22] Invalid argument: 'C:\\Users\\hubin\\AppData\\Local\\Temp\\pip-unpack-qus07tyx\\pyinstaller-5.7.0-py3-none-win_amd64.whl'
2. Failure analysis
It is good to install other packages with pip, but this pyinstaller will prompt that the path parameters are incorrect, but the path itself is completely legal.
Manually go to the python official website to download the installation package:
pyinstaller-5.7.0-py3-none-win_amd64.whl
Try to install manually again
pip install pyinstaller-5.7.0-py3-none-win_amd64.whl
still prompt error
But at this time I noticed one thing, that is, the downloaded whl installation package file suddenly disappeared. . .
Artifact scene, but it did happen, which would explain why the installation didn't work because the file itself was removed.
The first reaction was that the anti-virus software killed it. My operating system is the latest version of win11. I opened the windows security security center and checked the anti-virus history. Sure enough, it killed it.
3. Solve the problem
Now that the reason is found, it is the reason of the anti-virus software, then it is easy to handle, you can temporarily close the anti-virus software, and then try to install it.
After that, it went smoothly. After the installation is complete, turn on the anti-virus real-time protection again.