How to install PyQt5 on a new virtualenv and work on an IDLE

后端 未结 5 1493
悲&欢浪女
悲&欢浪女 2021-02-15 01:37

I installed PyQt5 globally on my win7 system (python 3.3), using the installer provided from the official riverbank website.

Then i created a new –no-site-package

5条回答
  •  闹比i
    闹比i (楼主)
    2021-02-15 02:20

    Assuming you have PyQt5 installed globally, there's a way you can give your virtualenv access to it without using --system-site-packages. A package called vext makes it possible. It works with other packages as well, but in this case we'll just be setting up the PyQt5 support.

    Run the following command from within your virtualenv and you should be good to go:

    pip install vext.pyqt5
    

    To check the status, run vext -l. You should see something like the following:

    Running in virtualenv [enabled]
    pyqt5.vext
    

    Or, run vext -c pyqt5.vext. You should see something like the following:

    import sip: [success]
    import PyQt5: [success]
    

    Alternatively you can just try to import PyQt5, e.g. python -c 'import PyQt5'.

提交回复
热议问题