[Environment]
- vscode
- Anaconda
- Window
I successfully ran main_for_exe.py in vscode.
When I make exe file using pyinstaller and then ran exe file, however, I have the below error message.
Now open your project in VS Code, after activating anaconda environment, run pip show numpy
to check if its location is anaconda\lib\site-packages
. If not, please reinstall it, then regenerate .exe, the error should go away.
Reference: Select and activate Environment.
CodePudding user response:
I solved this problem!
I just upgraded the pyinstaller package.
It seems that the pyinstaller package, before upgrade, cannot find the site-package path where the modules installed by anaconda are located. (Generally site-packe path: "~/anaconda3/lib/site-packages")
In this case, there are two solutions.
- First, you just upgrade pyinstaller.
- Second, you add site-package path to hookspath and then run "pyinstaller main.spec".