Python Forum
Updating Python version from command prompt and Conversion from PyQt4 to PyQt5 - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: GUI (https://python-forum.io/forum-10.html)
+--- Thread: Updating Python version from command prompt and Conversion from PyQt4 to PyQt5 (/thread-11630.html)



Updating Python version from command prompt and Conversion from PyQt4 to PyQt5 - Vysero - Jul-18-2018

Running: Ubuntu 16.04 and Python 3.5.2

So I ran a script which I found here: https://github.com/rferrazz/pyqt4topyqt5
in order to convert one of my projects built in PyQt4 into a PyQt5 project.

I ran the script and the conversion was made just fine with no errors. Essentially, everywhere QtGui() was used was changed to QtWidgets(). The only problem, when I try to run the new PyQt5 project I get the following error:

ImportError: /usr/local/lib/python3.5/dist-packages/PyQt5/QtGui.so: undefined symbol: PySlice_AdjustIndices

I am not positive but it seemed to me this would be a version error of some kind, which brings me to my questions. Is there a method of updating Python from 3.5 to the newest version release which I believe is 3.7 from the command prompt? Also, is the ImportError I got a version control issue like I believe it to be?


RE: Updating Python version from command prompt and Conversion from PyQt4 to PyQt5 - Larz60+ - Jul-18-2018

I cloned the original code and could not find PySlice_AdjustIndices, spelling?

for command line install, see: https://www.digitalocean.com/community/tutorials/how-to-install-python-3-and-set-up-a-programming-environment-on-an-ubuntu-16-04-server

latest update is 3.7.0


RE: Updating Python version from command prompt and Conversion from PyQt4 to PyQt5 - Vysero - Jul-18-2018

(Jul-18-2018, 09:50 PM)Larz60+ Wrote: I cloned the original code and could not find PySlice_AdjustIndices, spelling?

for command line install, see: https://www.digitalocean.com/community/tutorials/how-to-install-python-3-and-set-up-a-programming-environment-on-an-ubuntu-16-04-server

latest update is 3.7.0

You cloned and tried converting a simple Qt4 project into a Qt5 project and you did not get the PySlice_AdjustIndices ImportError? If that is the case which version of python are you using because I am not going to bother downloading 3.7 if it works with my version.


RE: Updating Python version from command prompt and Conversion from PyQt4 to PyQt5 - Larz60+ - Jul-18-2018

Quote:tried converting a simple Qt4 project into a Qt5 project
I didn't try converting a project.
I am using 3.7.0.
I you post code, I will try to convert.
There's more to it than this package, is that correct?
I also don't know anything about this package. It's not part of the PyPi repository, and hasn't been updated since May of last year.


RE: Updating Python version from command prompt and Conversion from PyQt4 to PyQt5 - Vysero - Jul-19-2018

(Jul-18-2018, 10:58 PM)Larz60+ Wrote:
Quote:tried converting a simple Qt4 project into a Qt5 project
I didn't try converting a project. I am using 3.7.0. I you post code, I will try to convert. There's more to it than this package, is that correct? I also don't know anything about this package. It's not part of the PyPi repository, and hasn't been updated since May of last year.

Yeah the actual package seems to work just fine. I think the problem, in general, is that PyQt5 only works for 3.7 but I was hoping to figure out if that was for sure the reason before I updated python. I guess I am worried I might have to re-download all of my modules. I am new to python and therefore, I have never updated an existing version before.