question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

can not generate standalone pyside2

See original GitHub issue

nuitka3 --standalone test.py

import sys
from PySide2.QtWidgets import QApplication, QMessageBox

app = QApplication(sys.argv)

msg_box = QMessageBox()
msg_box.setText("Hello World")
msg_box.show()

sys.exit(msg_box.exec_())

Error:

File "/home/rx67ds/.local/lib/python3.6/site-packages/nuitka/__main__.py", line 180, in <module>
    main()
  File "/home/rx67ds/.local/lib/python3.6/site-packages/nuitka/__main__.py", line 174, in main
    MainControl.main()
  File "/home/rx67ds/.local/lib/python3.6/site-packages/nuitka/MainControl.py", line 796, in main
    filename = filename
  File "/home/rx67ds/.local/lib/python3.6/site-packages/nuitka/MainControl.py", line 152, in createNodeTree
    Optimization.optimize(main_module.getOutputFilename())
  File "/home/rx67ds/.local/lib/python3.6/site-packages/nuitka/optimizations/Optimization.py", line 533, in optimize
    makeOptimizationPass(initial_pass = True)
  File "/home/rx67ds/.local/lib/python3.6/site-packages/nuitka/optimizations/Optimization.py", line 446, in makeOptimizationPass
    changed = optimizeModule(current_module)
  File "/home/rx67ds/.local/lib/python3.6/site-packages/nuitka/optimizations/Optimization.py", line 170, in optimizeModule
    optimizeShlibModule(module)
  File "/home/rx67ds/.local/lib/python3.6/site-packages/nuitka/optimizations/Optimization.py", line 164, in optimizeShlibModule
    signal_change = signalChange
  File "/home/rx67ds/.local/lib/python3.6/site-packages/nuitka/plugins/Plugins.py", line 84, in considerImplicitImports
    plugin.considerImplicitImports(module, signal_change)
  File "/home/rx67ds/.local/lib/python3.6/site-packages/nuitka/plugins/PluginBase.py", line 89, in considerImplicitImports
    for full_name in self.getImplicitImports(module):
  File "/home/rx67ds/.local/lib/python3.6/site-packages/nuitka/plugins/standard/ImplicitImports.py", line 74, in getImplicitImports
    for used_module in module.getUsedModules():
  File "/home/rx67ds/.local/lib/python3.6/site-packages/nuitka/nodes/ModuleNodes.py", line 869, in getUsedModules
    self._readPyPIFile()
  File "/home/rx67ds/.local/lib/python3.6/site-packages/nuitka/nodes/ModuleNodes.py", line 848, in _readPyPIFile
    assert imported.endswith(')')
AssertionError

I tried to change: from PySide2.QtWidgets import QApplication, QMessageBox to:

PySide2.QtWidgets import QApplication
PySide2.QtWidgets import QMessageBox

same error reported

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:15 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
kayhayencommented, Oct 26, 2019

It unfortunately is, @johndoe46

Unlike PyQt, they refused our patches, and now there is little inclination to rectify this from our side it seems. But I guess, you can just use PyQt5 and be good.

0reactions
JorjMcKiecommented, Oct 28, 2019

ok, but you also should be fine with the conventional compile command

python -m nutika --standalone --enable-plugin=qt-plugins=sensible ...

except maybe compile time and dist foldersize.

Read more comments on GitHub >

github_iconTop Results From Across the Web

maya standalone with pyside2 - python - Stack Overflow
When I want to add a QtWidget in maya standalone, error says "QWidget: Cannot create a QWidget without QApplication". then I add a...
Read more >
Create your first PySide2 app in Qt Designer - Python GUIs
You can create a standalone class which handles loading of the UI files, creating and customized the windows and contains any business logic...
Read more >
[#PYSIDE-558] Provide portable PySide2 wheel via pip
Here's a formal request to make it easier to distribute PySide2 using a wheel. Portable (do not require Qt installed, bundle it in...
Read more >
PySide2 - PyPI
PySide2 is the official Python module from the Qt for Python project, ... You can obtain more information about the options to build...
Read more >
Working with PySide in Maya | Autodesk
setWindowFlags(Qt.Window) # Make this widget a parented standalone window hello.show() hello = None # widget is parented, so it will not be destroyed....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found