22

I have installed Qt5 from the Qt5 project site, to the following directory

/opt/Qt5 

I would also like to mention that I had Qt4 installed previously, I have removed all instances of Qt4 through the software center.

Now that I issue designer from the command prompt, the system gives the following error:

designer: could not exec '/usr/lib/x86_64-linux-gnu/qt4/bin/designer': No such file or directory

What can be done to correct this problem?

Avinash Raj
  • 78,556
Indian
  • 1,560

5 Answers5

38

Replace Default Qt version paths in:

/usr/lib/x86_64-linux-gnu/qtchooser/default.conf
or in newer releases /usr/lib/x86_64-linux-gnu/qt-default/qtchooser/default.conf:

/opt/Qt5/bin
/opt/Qt5/lib

Check:

qtchooser -print-env

Reference: man qtchooser

user.dz
  • 48,105
  • 4
    Actually the file /usr/lib/x86_64-linux-gnu/qtchooser/default.conf is a symlink to the one in /usr/share/qtchooser/default.conf – Anwar Jun 10 '17 at 05:55
3

Proper path to qt default config: /usr/lib/x86_64-linux-gnu/qt-default/qtchooser/default.conf

muru
  • 197,895
  • 55
  • 485
  • 740
  • 2
    You may want to suggest this as an edit to the other answer. The answer section should be reserved for entire answers. – David Foerster Mar 21 '15 at 01:42
  • Yes qtchooser will look at the default.conf, you can create a symlink ln -s /usr/lib/x86_64-linux-gnu/qtchooser/qt5.conf /usr/lib/x86_64-linux-gnu/qtchooser/default.conf – Melroy van den Berg Aug 04 '17 at 22:15
2

For all of those who didn't uninstal old version and are wondering how to change the qt directory location. The correct way is to export the QT_SELECT variable and add the custom ~/.config/qtchooser/somename.conf file.

This will be a qt installation visible in qtchooser -l under "somename". So that:

 QT_SELECT=somename; qtchooser -print-env 

Will return your custom location. The downside of changing the default.conf is that it might invalidate where your old qt version is found, when I did change it to /some/path, after executing:

QT_SELECT=qt4; qtchooser -print-env

It find the newer version on my path, however with the ~/config/qtchooser/somename.conf the earlier version is intact.

It is mentioned at the end of the man qtchooser help:

FILES /etc/xdg/qtchooser/*.conf System-wide configuration files. Each has two lines, the first is the path to the binaries and the second is the path to the Qt libraries. If a default.conf is provided, the settings from it will be automatically used in case nothing else is selected.

$HOME/.config/qtchooser/*.conf configuration files

cerkiewny
  • 123
1

Directory location for ubuntu pip install qt5-tools: /home/user/.local/lib/python3.10/site-packages/qt5_applications/Qt/bin/designer

Maybe add it to path or .bashrc.

export PATH=$PATH:/home/"userName"/.local/lib/python3.10/site-packages/qt5_applications/Qt/bin

and 'or' you can put a link in your home directory to run "./designer"

ln -s /home/user/.local/lib/python3.10/site-packages/qt5_applications/Qt/bin/designer /home/user/designer

0

I tried the answers suggesting to check the configuration in the qtchooser, but I didn't manage to get it to work. The solution that worked for me was simply to add the right qt version to PATH. 5.11 in my case.

export PATH="/opt/qt511/bin:$PATH"
SydB
  • 1
  • 1