5

First I install QScintilla by following steps:

1:

cd Qt4Qt5
qmake qscintilla.pro
sudo make
make install

2:

cd ../designer-Qt4Qt5
qmake designer.pro
sudo make
sudo make install

3:

cd ../Python
python3 configure.py --pyqt=PyQt5
sudo make

And here I met the problem :

QAbstractScrollArea: No such file or directory 

and problem:

qprinter.h: No such file or directory

But I finally solved them by manually add required files.

Goes on:

sudo make install

4:

then I go to install eric6 by typing:

sudo python3 install.py

But I got:

Checking dependencies

Python Version: 3.4.0

Found PyQt5

Sorry, please install QScintilla2 and its PyQt5/PyQt4 wrapper.

Error: /usr/lib/python3/dist-packages/PyQt5/Qsci.so: undefined symbol: _ZTI13QsciScintilla

ekhumoro
  • 115,249
  • 20
  • 229
  • 336
Zieng
  • 453
  • 1
  • 7
  • 17

3 Answers3

3

The main problem is that you are linking against Qt4 rather than Qt5. This is why the QAbstractScrollArea and QPrinter headers are reported as missing, and why you later get the undefined symbol error.

QScintilla uses a features file to control compile-time configuration, and its sources need to be patched to get a good build for Qt5.

So first unpack a fresh set of sources, and then make these changes:

designer-Qt4Qt5/designer.pro:

TARGET = qscintillaplugin_qt5

Qt4Qt5/features/qscintilla2.prf:

        } else {
            LIBS += -lqscintilla2_qt5
        }
    }
} else {
    LIBS += -lqscintilla2_qt5
}

Qt4Qt5/qscintilla.pro:

TARGET = qscintilla2_qt5
...
features.path = $$[QT_INSTALL_ARCHDATA]/mkspecs/features

This will ensure that you get independent qscintilla libs for Qt5.

With that done, take the following steps to build (as a normal user):

cd 'path/to/src/Qt4Qt5'

# this is essential for correct linking
export QMAKEFEATURES="$PWD/features"

# make sure you use the right qmake!
qmake-qt5 'qscintilla.pro'
make

# plugin for Qt5 Designer
cd '../designer-Qt4Qt5'
qmake-qt5 'designer.pro' INCLUDEPATH+='../Qt4Qt5' QMAKE_LIBDIR+='../Qt4Qt5'
make

# Python bindings
cd '../Python'
python3 'configure.py' --pyqt='PyQt5' --qmake='/usr/bin/qmake-qt5' \
        --qsci-incdir='../Qt4Qt5' --qsci-libdir='../Qt4Qt5'
make

If successful, you can then install everything (as root):

cd 'path/to/src/Qt4Qt5'
make install

cd '../designer-Qt4Qt5'
make install

cd '../Python'
make install
ekhumoro
  • 115,249
  • 20
  • 229
  • 336
  • Finally I solved the problem but more problems come after that. I install Qt5.4.1 under /opt, but from `from PyQt5 import QtCore;print(QtCore.QT_VERSION_STR)` the version is 5.2.1, can you tell me how to make python use the version under /opt file? – Zieng Jun 10 '15 at 06:17
  • @Zieng. See the comment in my answer: "make sure you use the right qmake!". You need to specify the full path of the qmake installed under `/opt` when compiling. – ekhumoro Jun 10 '15 at 16:53
  • Now my problem is that I can't build the correct QtSql.so. I think this is nothing to do with QScintilla2 because while I install eric6 it said that "found QScintilla2", and it's nothing to do with qmake version because while I build PyQt5 or install Qt5 I didn't even use qmake. So ,what I am going to solve is find out how to build the correct QtSql.so.@ekhumoro – Zieng Jun 11 '15 at 12:02
  • @ekhumoro.Finally I solved all problems by removing all the old version and re-install all the lattest version.Thank you Very Much! – Zieng Jun 11 '15 at 15:49
0

ekhumoro's solution above did not quite work for me - let's just say maybe I missed something, or it's an environment-specific thing.

Anyway.... I did what ekhumoro advised except didn't edit these three files: (XXX)

- designer-Qt4Qt5/designer.pro
- Qt4Qt5/features/qscintilla2.prf
- Qt4Qt5/qscintilla.pro

the reason for editing them seems sound, but at the end of the day Eric install failed with:

Sorry, please install QScintilla2 and its PyQt5/PyQt4 wrapper.
Error:     
dlopen(/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/PyQt5/Qsci.so, 2):
Library not loaded: libqscintilla2_qt5.12.dylib
                                  ^^^^
Referenced from: /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/PyQt5/Qsci.so
Reason: image not found

note the _qt5 marked with ^^^^ - theoretically that should resolve, but for me it did not. I tried all kinds of things to no avail. May be my ignorance of some setting.

I expected ekhumoro's instructions to work, since the edits suggested for the 3 files - see (XXX) - configure Make to create libraries with _qt5. I tried many things - symlinks, etcetc., but at the end of the day, leaving out (XXX) allowed everything to proceed properly.

So - in summary, *if you don't need to have QScintilla work simultaneously with PyQt4 and PyQt5*, do ekhumoro's advice minus the stuff at (XXX) - that way, Eric should install without problems.

Take care with the information above: it will probably clobber QScintilla libs for Qt4

Community
  • 1
  • 1
user192127
  • 412
  • 3
  • 11
0

I guess the most important is --pyqt=PyQt5 which leads to using sip/qscimod5.sip instead of sip/qscimod4.sip. Difference is that it contains line %Import QtWidgets/QtWidgetsmod.sip which is essential for QAbstractScrollArea.

ony
  • 12,457
  • 1
  • 33
  • 41