[PyQt] New Set of Development Wheels for PyQt5 v5.6

Phil Thompson phil at riverbankcomputing.com
Thu Apr 21 15:24:31 BST 2016


On 19 Apr 2016, at 3:27 pm, Cosimo Lupo <cosimo.lupo at daltonmaag.com> wrote:
> 
> Could the `PyQt5.__init__.py` module be modified to automatically add the PyQt5 folder to the os.environ["PATH"], when the current platform is Windows?
> 
> If I patch it like that, I don't have to manually configure my environment everytime I install the pyqt5 wheel from pip in a new virtual environment.
> 
> Thanks.
> 
> 
> """
> import os as _os
> import platform as _platform
> 
> if _platform.system() == "Windows":
>     # on Windows we need to ensure PyQt5 is in the %PATH% for DLLs to be loaded
>     _pyqt5_dir = _os.path.dirname(__file__)
>     _env_path = _os.environ.get("PATH", "")
>     if _pyqt5_dir not in [pth.rstrip(_os.sep) for pth in _env_path.split(_os.pathsep)]:
>         _os.environ["PATH"] = _os.pathsep.join([_pyqt5_dir, _env_path])
> """

That's a good idea. I will actually implement it in the C code where the qt.conf handling is done.

Thanks,
Phil


More information about the PyQt mailing list