Ask Your Question
0

PyQt5 isn't working for python3 but it works with python

asked 2016-10-16 16:47:30 -0600

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

I'm using fedora 24. I've installed PyQt5. But it doesn't work with python3 (e.g. python 3.5). But it works with python (e.g python 2.7).

Please check below:

**[rumi@localhost Calculator]$** python calc_qt5.py

**[rumi@localhost Calculator]$** python3 calc_qt5.py

Traceback (most recent call last):
  File "calc_qt5.py", line 9, in <module>
    from PyQt5 import QtCore, QtGui, QtWidgets
ImportError: No module named 'PyQt5'

**[rumi@localhost Calculator]$**

When I use "python calc_qt5.py" command, it works great! But when I use "python3 calc_qt5.py" command, I get error!

Can anyone help please?

edit retag flag offensive close merge delete

Comments

Did you install python3-qt5 package? (There are always two packages for python modules in Fedora -- python-foo for Python 2 and python3-foo for Python3.)

vtrefny gravatar imagevtrefny ( 2016-10-17 01:04:21 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-10-18 02:53:51 -0600

smearumi gravatar image

yes! I installed all possible packages from dnf repository for python3. Also, I tries pip/pip3! But that didn't work. Anyway, my problem is solved. I've compiled and installed PyQt5 and python 3.5.2 respectively from the source. It's working okay right now. Thank you very much for your attention to this matter and for the comment! :)

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-10-16 16:47:30 -0600

Seen: 406 times

Last updated: Oct 18 '16