Python Forum
Problems converting pyqt4 script to pyqt5 using pyqt4topyqt5.py
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problems converting pyqt4 script to pyqt5 using pyqt4topyqt5.py
#1
I am attempting to us a script I found on GitHub called pyqt4topyqt5.py: https://github.com/rferrazz/pyqt4topyqt5

The README says:

pyqt4topyqt5

pyqt4 -> pyqt5
Usage

usage: pyqt4topyqt5.py [-h] [--nosubdir] [--followlinks] [-o O]
[--diff [DIFF]] [--diffs] [--nolog] [--nopyqt5]
path

Basic example: porting the content of pyqt4app to pyqt5 in the directory pyqt5app:

pyqt4topyqt5.py pyqt4app -o pyqt5app

So I downloaded and unzipped the file and I figured all I would need to do is bring my pyqt4 script into the folder, open up a terminal and type pyqt4topyqt5 myscript -o myscript_qt5, that did not work:
Error:
pyqt4topyqt5: command not found
So I tried a few other things:
$ pyqt4topyqt5 myscript -o pyqt5app
$ pyqt4topyqt5 myscript.py -o newscript.py
$ pyqt4topyqt5 myscript
$ pyqt4topyqt5 myscript -o newscript

All yielding the same result as before.

I tried opening pyqt4topyqt5 in my IDE and running it and the error is:
Error:
usage: pyqt4topyqt5.py [-h] [--nosubdir] [--followlinks] [-o O] [--diff [DIFF]] [--diffs] [--nolog] [--nopyqt5] path pyqt4topyqt5.py: error: the following arguments are required: path
Which makes sense, the script needs to know where my pyqt4 script is located. This is why originally I thought just bringing the script directly into the pyqt4topyqt5-master folder (the folder created after unzipping the file) would work.

So now I am left wondering how I am supposed to use this script. I am pretty green when it comes to Linux. Anyone have any idea how to use this script or rather, what I am doing wrong?
Reply
#2
You must start pyqt4topyqt5.py from the folder where it is stored.

for example in Linux:(please adjust paths)

Quote:cd /folder_where_pyqt4topyqt5_is_stored/
./pyqt4topyqt5.py /folder/Qt4file.py -o /folder/Qt5file.py
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Problems passing arguments containing spaces to bash script and then on to python kaustin 6 333 Apr-03-2024, 08:26 PM
Last Post: deanhystad
  Database connection problems [login, PyQt5, PySql] gradlon93 5 690 Dec-15-2023, 05:08 PM
Last Post: deanhystad
  "ModuleNotFoundError: No module named 'PyQt5.QtWidgets'; 'PyQt5' is not a package" chipx 3 7,410 Dec-09-2021, 07:05 AM
Last Post: chipx
  [split] Help- converting file with pyton script eltomassito 6 3,233 Jul-02-2021, 05:29 PM
Last Post: snippsat
  Help- converting file with pyton script grinleon 3 2,476 Sep-23-2020, 11:48 AM
Last Post: grinleon
  Converting to exe problems francisco_neves2020 12 6,622 Apr-20-2019, 11:58 PM
Last Post: francisco_neves2020
  problems with python script and special characters last08 1 2,284 Mar-29-2019, 09:28 AM
Last Post: Kebap
  converting python script to another version gptura 5 4,706 Mar-13-2018, 12:16 PM
Last Post: gptura
  Problems with not having exceptions crash my script league55 7 4,834 Feb-16-2018, 09:06 PM
Last Post: DeaD_EyE
  PyInstaller: ImportError, no module name 'PyQt4' panoss 1 8,102 Jan-24-2017, 11:13 AM
Last Post: panoss

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020