-1

NOTE- I am JAVA developer and newbie in Python

I have a very old project that is build on Python2 and have two parts client and app , I want to install the client on my MAC M1 but for that it needs python2 with pyqt4 .

I have got python2 installed and able to use it to run client from command line , but now I want o start it on UI as well for which pyqt4 is needed , I have tried building the same but getting errors

~/Downloads/Qt4/qt-mac-opensource-src-4.4.3/include/QtCore/../../src/corelib/tools/qlist.h:50:10: fatal error: 'new' file not found
#include <new>
         ^~~~~
1 error generated.
make: *** [option.o] Error 1

and yes I have tried upgrading the whole project to python3 and pyqt5 , and was able to get multiple things working but unfortunately , since the project is more like an IDE and running it with python3 causes the code written inside it to compile with python3 as well , which I don't want .

I have tried building PyQt5 using QT 5.4 but it gives error for

user1@MACM1PRO PyQt5-5.15.9 % python2 configure.py --qmake /Users/user1/Qt5.4.1/5.4/clang_64/bin/qmake --verbose Querying qmake about your Qt installation... Determining the details of your Qt installation... /Users/user1/Qt5.4.1/5.4/clang_64/bin/qmake -o cfgtest_QtCore.mk cfgtest_QtCore.pro make -f cfgtest_QtCore.mk /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -headerpad_max_install_names -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -mmacosx-version-min=10.7 -Wl,-rpath,/Users/user1/Qt5.4.1/5.4/clang_64/lib -o cfgtest_QtCore.app/Contents/MacOS/cfgtest_QtCore cfgtest_QtCore.o -F/Users/user1/Qt5.4.1/5.4/clang_64/lib -framework QtCore -framework DiskArbitration -framework IOKit clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated] ld: library not found for -lstdc++ clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [cfgtest_QtCore.app/Contents/MacOS/cfgtest_QtCore] Error 1 Error: Failed to determine the detail of your Qt installation. Try again using the --verbose flag to see more detail about the problem.

QMake details

user1@MACM1PRO PyQt5-5.15.9 % /Users/user1/Qt5.4.1/5.4/clang_64/bin/qmake -query QT_SYSROOT: QT_INSTALL_PREFIX:/Users/user1/Qt5.4.1/5.4/clang_64 QT_INSTALL_ARCHDATA:/Users/user1/Qt5.4.1/5.4/clang_64 QT_INSTALL_DATA:/Users/user1/Qt5.4.1/5.4/clang_64 QT_INSTALL_DOCS:/Users/user1/Qt5.4.1/Docs/Qt-5.4 QT_INSTALL_HEADERS:/Users/user1/Qt5.4.1/5.4/clang_64/include QT_INSTALL_LIBS:/Users/user1/Qt5.4.1/5.4/clang_64/lib QT_INSTALL_LIBEXECS:/Users/user1/Qt5.4.1/5.4/clang_64/libexec QT_INSTALL_BINS:/Users/user1/Qt5.4.1/5.4/clang_64/bin QT_INSTALL_TESTS:/Users/user1/Qt5.4.1/5.4/clang_64/tests QT_INSTALL_PLUGINS:/Users/user1/Qt5.4.1/5.4/clang_64/plugins QT_INSTALL_IMPORTS:/Users/user1/Qt5.4.1/5.4/clang_64/imports QT_INSTALL_QML:/Users/user1/Qt5.4.1/5.4/clang_64/qml QT_INSTALL_TRANSLATIONS:/Users/user1/Qt5.4.1/5.4/clang_64/translations QT_INSTALL_CONFIGURATION: QT_INSTALL_EXAMPLES:/Users/user1/Qt5.4.1/Examples/Qt-5.4 QT_INSTALL_DEMOS:/Users/user1/Qt5.4.1/Examples/Qt-5.4 QT_HOST_PREFIX:/Users/user1/Qt5.4.1/5.4/clang_64 QT_HOST_DATA:/Users/user1/Qt5.4.1/5.4/clang_64 QT_HOST_BINS:/Users/user1/Qt5.4.1/5.4/clang_64/bin QT_HOST_LIBS:/Users/user1/Qt5.4.1/5.4/clang_64/lib QMAKE_SPEC:macx-clang QMAKE_XSPEC:macx-clang QMAKE_VERSION:3.0 QT_VERSION:5.4.1

Any help or pointer will be helpful .

gladiator
  • 1,249
  • 8
  • 23
  • 1
    You have two major problems: 1. the version you're trying to build is **extremely** old (Qt 4.4 was released 15 years ago), which means that you probably need some tweaking for the C++ compiler, and you also should keep in mind that when Qt 4 was developed, it was merely developed for x86 and PowerPC architectures (old macs before switching to Intel), and other architectures were only supported for "Embedded Qt" so there could also be issues for some fine-tuned low-level aspects that were used at the time (note that I'm no C++ expert, and I may just be telling lots of cr*p on this point). – musicamante Aug 04 '23 at 21:38
  • 1
    2. Apple is known for completely disregarding backward support (and, objectively speaking, 15 years are *a lot of time*), so, even if you are able to compile Qt4, the program will probably fail sooner or later - assuming it's even able to start; that's because Qt strictly relies on the API that the current OS provides, and many of them have been probably dropped in OSX/macOS in the last 15 years. You may have more luck by trying to run an *older* OSX version in a virtual machine. – musicamante Aug 04 '23 at 21:45
  • thanks even i thought same of arch , i tries bit of tricks here and there on it too and got message like library is for i386 and not for x86 or arm64 – gladiator Aug 05 '23 at 04:00
  • I am assuming you cannot share the original code. Have you attempted with virtual env by chance? – kyrlon Aug 13 '23 at 02:15
  • Pyenv i tried but its same result or you mean running older mac os in vm – gladiator Aug 13 '23 at 13:25
  • @gladiator More so the former, but the VM idea is not bad approach if you can get a working mac VM. – kyrlon Aug 14 '23 at 00:33
  • 1
    Like musicamante said, Apple Silicon will most likely be incompatible with whatever you are trying to do. You may be running into a hardware compatibility problem here and can't get too far. If you're still trying things, make sure you have Rosetta 2 installed and activated in order to ensure your Mac can run non-ARM stuff. – Microbob Aug 14 '23 at 01:31

0 Answers0