frescobaldi / python-poppler-qt5

Python binding to libpoppler-qt5
Other
42 stars 32 forks source link

Possibly incorrect default value for `pyqt_sip_dir` #34

Closed parekhnish closed 3 years ago

parekhnish commented 4 years ago

(Environment instructions at the end of this post)

When performing setup.py build_ext without any additional options, the script uses this code to determine pyqt_sip_dir: https://github.com/frescobaldi/python-poppler-qt5/blob/22e0f8ba0a136fff74fdb98190e9d7d4c84395f3/setup.py#L205-L211

For my version of PyQt5 == 5.14.1, the if self.pyqtconfig check failed, so the code got the directory from sipconfig. Thus, the value of the directory was set to:

pyqt_sip_dir = "/path/to/virtualenv/share/sip/PyQt5"

which caused an error in the build process:

sip: Unable to find file "QtCore/QtCoremod.sip" 

I figured this was because pyqt_sip_dir was possibly incorrect; manually checking that path revealed there was no such folder! Instead, I had to supply manually a path, with the cmdline argument:

--pyqt-sip-dir==/path/to/virtualenv/lib/python3.7/site-packages/PyQt5/bindings

, and this was the only change needed for setup.py build to successfully build the library.

I wonder if this is an issue with the install for sip itself, installation of PyQt5, or if the way pyqt_sip_dir is set; Is it possible to change the default from the sipconfig way to this /lib/python/... way?


My Environment:

Using pipenv:

wbsoft commented 3 years ago

Fixed by merge.