LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   GNS3 has a QtCore.QT_VERSION problem on archlinux up to date 2014-10-1 (https://www.linuxquestions.org/questions/linux-software-2/gns3-has-a-qtcore-qt_version-problem-on-archlinux-up-to-date-2014-10-1-a-4175522197/)

gbcbooks 10-15-2014 04:31 AM

GNS3 has a QtCore.QT_VERSION problem on archlinux up to date 2014-10-1
 
hi Guy
i notice that GNS3 0.8.7 official release can not work under arch linux with pyqt4 environment installed, error prompt as follow
Code:

Need Qt v4.6 or higher, but got v%s" % QtCore.QT_VERSION_STR
i read the gns3 initiation file of which filename is gns3.pyw , a python script
here is what i saw
Code:


 if QtCore.QT_VERSION < 0x040600:
    raise RuntimeError, "Need Qt v4.6 or higher, but got v%s" % QtCore.QT_VERSION_STR

 if QtCore.PYQT_VERSION < 0x040500:
    raise RuntimeError, "Need PyQt v4.5 or higher, but got v%s" % QtCore.PYQT_VERSION_STR

the QT and PyQt versions need to be checked before running the application

so i wrote another simple Python script to print which version did gns3 get
Code:

  1 #!/usr/bin/python
  2 import sys, os, time, traceback
  3 print "++++++++++++++"
  4 print sys.version_info
  5 from PyQt4 import QtCore, QtGui
  6 print "QtCore.QT_VERSION_STR=" + QtCore.QT_VERSION_STR
  7 print "QtCore.QT_VERSION="+QtCore.QT_VERSION
  8 print  "QtCore.PYQT_VERSION_STR="+QtCore.PYQT_VERSION_STR

as the outpunt is
Code:

QtCore.QT_VERSION_STR=4.8.6
QtCore.QT_VERSION=40806
QtCore.PYQT_VERSION_STR=4.11.2

looks like the pyqt version does not meet the qualification of gns3 required.

i start the next step to fix the problem
pacman -S pyqt

there is only python-pyqt4-4.11.2 can be installed

i try to import pyqt5 instead of pyqt4 in the script of gns3

but it print out the same error,
and i dont understand , my pyqt5 version is 5.3.2-1
it is still can meet the require of gns3, the QtCore.QT_VERSION_STR output 0x050302,is totally over 0x040600, why i got the same error.

does anyone run gns3 successfully with kernel 3.16 on archlinux up to date 2014-10-01, please tell me your solution.

knudfl 10-15-2014 04:44 AM

PyQt 4.11.2 is not Qt.

The required package name is "qt4"
. ftp://ftp.u-tx.net/archlinux/extra/os/i686/
. ftp://ftp.u-tx.net/archlinux/extra/os/x86_64/

gbcbooks 10-15-2014 04:53 AM

Quote:

Originally Posted by knudfl (Post 5254034)
PyQt 4.11.2 is not Qt.

The required package name is "qt4"
. ftp://ftp.u-tx.net/archlinux/extra/os/i686/
. ftp://ftp.u-tx.net/archlinux/extra/os/x86_64/

thanks for you quick reply , i have qt4 and qt5 install on my arch linux

see the python script output

QtCore.QT_VERSION=4.8.6

gbcbooks 10-15-2014 09:53 AM

i think i make a mistake of the error output
here is the original error output
Code:

  File "./gns3", line 43
    raise RuntimeError, "Need Qt v4.6 or higher, but got v%s" % QtCore.QT_VERSION_STR
                                        ^
SyntaxError: invalid syntax

it is a syntax error

i check my default python version by the following command
Code:

ls -l /usr/bin/python
lrwxrwxrwx 1 root root 7 Oct  8 21:58 /usr/bin/python -> python3

seem my default python version has been linked to python3

after i recreate the python link to python2.7 , gns3 works properly

Code:

mv /usr/bin/python /usr/bin/python.bak
ln -s /usr/bin/python2 /usr/bin/python

or Change the shell environment which define in the begining of file gns3.pyw from
Code:

#!/usr/bin/env python
to
Code:

#!/usr/bin/python2
the problem has been solved .

knudfl 10-15-2014 12:56 PM

Please mark the thread as SOLVED :

"Thread Tools" → *SOLVED*


All times are GMT -5. The time now is 01:43 AM.