简体   繁体   中英

ModuleNotFoundError with pyinstaller but fine in Pycharm

I'm trying to convert a .py project to an .exe file using the using the Auto Py To Exe which uses the pyinstaller.

Running my code inside pycharm I get no errors. Running the .exe file i'm getting the error:

Traceback (most recent call last):
    File "objectGui.py", line 6, in <module>
    ModuleNotFoundError: No module named 'scipy'
    [19724] Failed to execute script objectGui

I've tried adding following bit of code to the conversion

--hidden-import scipy 

This does not change the error I keep getting.

Any suggestions?

I have found the solution in this post .

Since I worked on my project in an environment (PyCharm) I needed to type in the command in the PyCharm terminal for it to work. I also added the hidden import:

  --hidden-import scipy 

to find the module and it worked!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM