pyinstaller 打包提示 no module named "xxxxx"

情况1 使用 virtualenv 安装 pyinstaller

1.删除build目录。。

pip install pyinstaller
:: 重加载一下cmd
venv\scripts\active.bat
pyinstaller -F -w 2.py

情况2 使用virtualenv 不安装 pyinstaller

1.删除build目录。。
2.复制包文件,如 pyautogui pyperclip 到脚本目录。
3.重新打包
结构类似

pyautogui\
pyperclip\
venv\
hi.py

再打包

pyinstaller -F -w 2.py
posted @ 2022-09-09 09:32  wgf4242  阅读(254)  评论(0编辑  收藏  举报