Upgrade from python3.6 to python3.8 causing issues

More
29 Aug 2021 23:47 - 29 Aug 2021 23:49 #219133 by Uthayne
I have been keeping up with master while doing run-in-place installs, and recently a package has changed to require >=python3.7 so I upgraded my system from python3.6.9 to python3.8.0. I re-ran ./configure and it completed successfully as did make. So far, so good.

I then set the rip-environment and run linuxcnc and select my QtPlasmaC config (qtvcp) when it throws the error below:
Debug file information:
Note: Using POSIX realtime
Traceback (most recent call last):
  File "/home/bryan/linuxcnc-dev/bin/qtvcp", line 12, in <module>
    from PyQt5 import QtWidgets, QtCore
ImportError: cannot import name 'QtWidgets' from 'PyQt5' (/usr/lib/python3/dist-packages/PyQt5/__init__.py)
14675
14704
Stopping realtime threads
Unloading hal components
RTAPI_PCI: Unmapped 65536 bytes at 0x7f74fbb08000
Note: Using POSIX realtime
Inspecting /linuxcnc-dev/bin/qtvcp file shows that it was built for python3.8
#!/usr/bin/python3.8
and changing this to #!/usr/bin/python3.6 allows it to start without error. However, I know this is not the correct solution. Starting a python3.6 shell I am able to confirm that PyQt5 imports QtWidgets and QtCore just fine. There is an issue with the way my python3.8 is set up. The modules in /usr/lib/python3 include the PyQt5 module, but since this was originally setup with python3.6 is there a way to direct python3.8 to use it as well? Obviously there is something I'm fundamentally missing about upgrading python versions.
Last edit: 29 Aug 2021 23:49 by Uthayne.

Please Log in or Create an account to join the conversation.

More
30 Aug 2021 01:42 #219137 by cmorley
Unfortunately It was actually a quick change in the confire file to support 3.6.9 :(

Did you try make clean first?

Please Log in or Create an account to join the conversation.

More
30 Aug 2021 02:09 #219138 by Uthayne
I tried a make clean as well as cloning into a fresh directory and it configured. Here is the output below:
bryan@bryan-linuxcnc:~/linuxcnc-dev3/src$ ./configure --with-realtime=uspace
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking how to run the C++ preprocessor... g++ -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking boost/lockfree/queue.hpp usability... yes
checking boost/lockfree/queue.hpp presence... yes
checking for boost/lockfree/queue.hpp... yes
checking whether g++ supports C++11 features by default... yes
checking build toplevel... /home/bryan/linuxcnc-dev3
checking installation prefix... run in place
checking for grep... (cached) /bin/grep
checking for egrep... (cached) /bin/grep -E
checking for pkg-config... /usr/bin/pkg-config
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking rpc/rpc.h usability... yes
checking rpc/rpc.h presence... yes
checking for rpc/rpc.h... yes
checking for rtai-config... none
checking for xeno-config... /usr/bin/xeno-config
checking for realtime API(s) to use... uspace+xenomai
checking whether to enable userspace PCI access... yes
checking for libudev... yes - version 237
checking for cc version... not specified
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking how to run the C preprocessor... gcc -E
checking for usability of linux/hidraw.h... yes
checking for usability of rpc/rpc.h... yes
checking for libmodbus3... yes - version 3.0.6
checking for libusb-1.0... yes
checking for module installation directory... configuring for run-in-place
/home/bryan/linuxcnc-dev3/rtlib
checking for glib... yes - 2.56.4
checking for GTK 3.22.4 or above... yes - 3.22.30
checking for GTK 2.4.0 or above... yes - 2.24.32
checking for libgnomeprintui-2.2... no -- printing from classicladder will not be possible
checking whether make sets $(MAKE)... yes
checking for ranlib... ranlib
checking for ar... /usr/bin/ar
checking for install... /usr/bin/install -c
checking for sed... /bin/sed
checking for ps... /bin/ps
checking for kill... /bin/kill
checking for whoami... /usr/bin/whoami
checking for awk... /usr/bin/awk
checking for pidof... /bin/pidof
checking for ipcs... /usr/bin/ipcs
checking for fuser... /bin/fuser
checking for yapps... /usr/bin/yapps
checking for mandb... /usr/bin/mandb
checking for intltool-extract... /usr/bin/intltool-extract
checking for yapps... (cached) /usr/bin/yapps
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for boostlib >=  (102000)... yes
checking for python build information... 
checking for python3.10... no
checking for python3.9... no
checking for python3.8... python3.8
checking for main in -lpython3.8... yes
  results of the Python check:
    Binary:      python3.8
    Library:     python3.8
    Include Dir: /usr/include/python3.8
checking for python3.8... /usr/bin/python3.8
checking for python... (cached) /usr/bin/python3.8
checking for a version of Python >= '2.1.0'... yes
checking for a version of Python >='3.7'... yes
checking for the distutils Python package... yes
checking for Python include path... -I/usr/include/python3.8
checking for Python library path... -L/usr/lib -lpython3.8
checking for Python site-packages path... /usr/lib/python3/dist-packages
checking python extra libraries... -lcrypt -lpthread -ldl  -lutil -lm -lm
checking python extra linking flags... -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions
checking consistency of all components of python development environment... yes
checking whether the Boost::Python library is available... yes
checking whether boost_python is the correct library... yes
checking whether to build documentation... no
checking sys/io.h usability... yes
checking sys/io.h presence... yes
checking for sys/io.h... yes
checking for ANSI C header files... (cached) yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for semtimedop... yes
checking for optreset... no
checking for library containing dlopen... -ldl
checking for library containing clock_nanosleep... none required
checking for tcl... /usr/lib/tcl8.6/tclConfig.sh found
checking for tk... /usr/lib/tk8.6/tkConfig.sh found
checking whether to check for runtime dependencies... yes
checking for BWidget using /usr/bin/tclsh8.6... found
checking for BLT using /usr/bin/tclsh8.6... found
checking for img::png using /usr/bin/tclsh8.6... found
checking for tclX using /usr/bin/tclsh8.6... found
checking for python pango and cairo modules... found
checking for X... libraries , headers 
checking for gethostbyname... yes
checking for connect... yes
checking for remove... yes
checking for shmat... yes
checking for IceConnectionNumber in -lICE... yes
checking X11/extensions/Xinerama.h usability... yes
checking X11/extensions/Xinerama.h presence... yes
checking for X11/extensions/Xinerama.h... yes
checking for XineramaQueryExtension in -lXinerama... yes
checking readline/readline.h usability... yes
checking readline/readline.h presence... yes
checking for readline/readline.h... yes
checking readline/history.h usability... yes
checking readline/history.h presence... yes
checking for readline/history.h... yes
Trying readline without -ltermcap
checking for readline in -lreadline... yes
Trying readline with -ltermcap
checking for readline in -lreadline... yes
Readline does not require -ltermcap
checking whether readline license is compatible with GPL-2... yes
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking for setlocale... yes
checking libintl.h usability... yes
checking libintl.h presence... yes
checking for libintl.h... yes
checking for gettext in -lintl... no
checking for xgettext... /usr/bin/xgettext
checking for msgfmt... /usr/bin/msgfmt
checking python version... OK
checking match between tk and Tkinter versions... 8.6
checking for site-package location... /usr/lib/python3/dist-packages
checking for working GLU quadrics... yes
checking for Xmu headers... checking X11/Xmu/Xmu.h usability... yes
checking X11/Xmu/Xmu.h presence... yes
checking for X11/Xmu/Xmu.h... yes
configure: creating ./config.status
config.status: creating ../scripts/rtapi.conf
config.status: creating ../scripts/linuxcnc
config.status: creating ../scripts/linuxcnc-python
config.status: creating ../scripts/linuxcnc_info
config.status: creating ../scripts/halrun
config.status: creating ../scripts/rip-environment
config.status: creating ../scripts/haltcl
config.status: creating ../scripts/halcmd_twopass
config.status: creating ../scripts/realtime
config.status: creating ../scripts/runtests
config.status: creating ../scripts/linuxcnc_var
config.status: creating ../scripts/linuxcnc-checklink
config.status: creating Makefile.inc
config.status: creating Makefile.modinc
config.status: creating ../tcl/linuxcnc.tcl
config.status: creating ../lib/python/nf.py
config.status: creating ../scripts/linuxcncmkdesktop
config.status: creating ../share/applications/linuxcnc-latency.desktop
config.status: creating ../share/applications/linuxcnc.desktop
config.status: creating ../share/desktop-directories/linuxcnc-cnc.directory
config.status: creating ../share/desktop-directories/linuxcnc-ref.directory
config.status: creating ../share/desktop-directories/linuxcnc-doc.directory
config.status: creating ../share/menus/CNC.menu
config.status: creating config.h


######################################################################
#                LinuxCNC - Enhanced Machine Controller              #
######################################################################
#                                                                    #
#   LinuxCNC is a software system for computer control of machine    #
#   tools such as milling machines. LinuxCNC is released under the   #
#   GPL.  Check out http://www.linuxcnc.org/ for more details.       #
#                                                                    #
#                                                                    #
#   It seems that ./configure completed successfully.                #
#   This means that RT is properly installed                         #
#   If things don't work check config.log for errors & warnings      #
#                                                                    #
#   Next compile by typing                                           #
#         make                                                       #
#         sudo make setuid                                           #
#          (if realtime behavior and hardware access are required)   #
#                                                                    #
#   Before running the software, set the environment:                #
#         . (top dir)/scripts/rip-environment                        #
#                                                                    #
#   To run the software type                                         #
#         linuxcnc                                                   #
#                                                                    #
######################################################################


bryan@bryan-linuxcnc:~/linuxcnc-dev3/src$ 

It is still requiring (or at least checking) for python >='3.7'. Is this what you're referring to when 3.6.9 should still be supported? I'm confused.
It compiles fine and I do not have a problem upgrading to python3.8 (or 3.9 for that matter), I just don't seem to have the modules pointed correctly and I am not sure how to fix that.

Please Log in or Create an account to join the conversation.

More
30 Aug 2021 02:20 #219139 by cmorley
Sorry I was complaining that the dev who set 3.7 as the minimum didn't need to do that.
3.6.9.(like mint 19) compiles and works just fine (well I had to back port one package too) - you would have to change one line in the config file.

But anyway that doesn't help your current problem.
I can't help you further (above my pay grade) but I would add a bug report to linuxcnc.
The python detection code was recently changed and it might be a bug.

Or hopefully someone else will chime in.

Please Log in or Create an account to join the conversation.

More
30 Aug 2021 03:53 #219142 by Uthayne
I believe the issue is that the shebang in ~/linuxcnc-dev/bin python files are defaulting to the newest system installed python3.X minor revision. Perhaps they could just be #!/usr/bin/python3 with only the major revision as the default. This is how it was defaulted 2 weeks ago according to an earlier commit I was on. I'm not exactly sure when this was changed by looking at the commit history.

Please Log in or Create an account to join the conversation.

Time to create page: 0.102 seconds
Powered by Kunena Forum