Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-857

Cannot run PySide2 application from conda environment

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • 5.11.2
    • Other
    • None
    • KDE
      No LSB modules are available.
      Distributor ID: Ubuntu
      Description: Ubuntu 18.04.1 LTS
      Release: 18.04
      Codename: bionic
    • Linux/X11

    Description

      Running Pyside2 code from conda environment return the following error :  

       

      qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found. 
      This application failed to start because no Qt platform plugin could be initialized. Reinstallin
      g the application may fix this problem.

       

      How to reproduce the bug ? 

      Install conda with Python 3.7: https://conda.io/miniconda.html

      Create conda environment :

      conda create -n test 

       

      Install Pyside2 

       

      pip install PySide2
      

      Run the following code 

       

      from PySide2.QtWidgets import * 
      from PySide2.QtCore import *
      import sys
      app = QApplication()
      w = QWidget()
      w.show() 
      app.exec_()  
      

      It doesn't show anything and return the following error 

      (test) ➜  ~ python test.py  
      qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found. 
      This application failed to start because no Qt platform plugin could be initialized. Reinstallin
      g the application may fix this problem. 
       
      Available platform plugins are: minimal, offscreen, xcb.

      If I don't use virtual environment, it works quite well. And PyQt5 runs well too in virtual environment.

      Tested on 2 Linux Computer. ( work with Mac and windows ) 

       

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              crmaurei Cristian Maureira-Fredes
              sschutz sacha schutz
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes