3

Up until Anaconda3 (which contains Python 3.4) was re-installed on my RedHat 6.5 workstation, I have been able to develop Python apps that use PyQT5.

Post re-install of Anaconda I receive an error message:

....could not find or load Qt platform plugin xcb

The only difference between Anaconda installs is the folder name: /usr/local/ananaconda3 vs /usr/local/anaconda_py3

I checked libqxcb.so has no missing dependencies. I rebuilt PyQT5. I tried explicitly adding location of site-packages of PyQT5:

import site
site.addsitedir("...path.../python3.4")

Any other suggestions?

How does re-installing Python impact the use of PyQT5?

Prof
  • 657
  • 1
  • 14
  • 24
user3047458
  • 143
  • 1
  • 2
  • 8
  • Try to reinstall Libxcb as in : http://wiki.qt.io/Building_Qt_5_from_Git#Linux.2FX11 – Nejat May 25 '15 at 03:48
  • 1
    I should mention I have [tag:PyQt4] installed in [tag:Anaconda]. Perhaps there is a problem having both together? – user3047458 May 26 '15 at 07:31

2 Answers2

7

This is an error caused by having two different versions of Qt under the same installation/environment.

Check the packages installed and their versions in your environment (if for some reason you're not working in a virtual environment, you can skip the first line):

source activate yourenvname 
conda list

If you see pyqt and qt both with version 4.X.X then remove them (assuming you want to work in Qt v5):

conda remove qt
conda remove pyqt
Prof
  • 657
  • 1
  • 14
  • 24
  • I have multiple versions of Qt on my system. But when I write `conda remove qt` it asks me to remove `Qt 5.6.0` which is the version I'm using and don't want to remove. Since I'm using Debian Jessie I have the Qt 4.8 (or so) preinstalled and probably this is the version that Anaconda is using. Is there a way to select which Qt version to remove? Is it actually removing the actual Qt installation or is it just removing the Anaconda packages? – rbaleksandar Jan 07 '17 at 21:54
  • 1
    Can't you do `conda remove qt 4.8`? – Prof Jan 08 '17 at 16:40
  • 1
    I have the same problem. I set environment variable QT_PLUGIN_PATH=/usr/local/anaconda_py3/pkgs/qt-5.6.0-0/plugins and it worked. I uninstalled it and reinstalled anaconda again. It also solved even without this environment variable. Don't know why. – syan Aug 14 '17 at 02:14
1

I had an issue that seems to match what happened here.
But in my case the solution was to "sudo rm -rf user/anaconda3" and reinstall it with "bash anaconda....sh", because I had previously installed it using sudo ("sudo bash anaconda....sh")