简体   繁体   中英

Pyinstaller app(console) won't work

I've trouble making an CONSOLE app work after packaging. App flashes once and closes. in terminal i've put: pyinstaller --onefile --windowed --icon=name.icns Script.py

So far i've tried running the app through terminal to try and get error ( you know like in windows but it failed lol ).

Is there a way to see the reason why it closed?

EDIT: When i run Executable within app i get this error:

File "Script.py", line 14, in <module>


File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/PyInstaller/loader/pyimod03_importers.py", line 389, in load_module
    exec(bytecode, module.__dict__)

File "site-packages/requests/__init__.py", line 43, in <module>

File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/PyInstaller/loader/pyimod03_importers.py", line 389, in load_module
    exec(bytecode, module.__dict__)

File "site-packages/urllib3/__init__.py", line 8, in <module>

File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/PyInstaller/loader/pyimod03_importers.py", line 389, in load_module
    exec(bytecode, module.__dict__)

File "site-packages/urllib3/connectionpool.py", line 28, in <module>

File "site-packages/urllib3/packages/six.py", line 92, in __get__

File "site-packages/urllib3/packages/six.py", line 115, in _resolve

File "site-packages/urllib3/packages/six.py", line 82, in _import_module
ImportError: No module named 'queue'

I have nothing about "queue" in code and .py works great and gives no import error.

Thank you.

Seems like there's an error importing one of your modules, perhaps its dependencies aren't being detected correctly.

You can try to explicitly add a module via the command line by including --hidden-import=queue , you might have to do this for more modules that haven't been detected. More discussion in this question .

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