解决方法:
在github这个页面上
https://github.com/yahuaguizhu/Pyinstaller.git
下载所有文件,解压后找到文件夹PyInstaller\depend\里的bindepend.py文件,然后copy下来,替换虚拟环境里\venv\Lib\site-packages\PyInstaller\depend\里的 bindepend.py
此时可以尝试运行
pyinstaller -F -w (项目).py
可以看到会多出两个文件夹,一个文件,在dist文件夹中存放的是桌面.exe程序