简体   繁体   English

在虚拟环境中使用PyQt5时发生致命的Python错误

[英]Fatal Python error when using PyQt5 in a virtual environment

I have made a virtual environment with venv, and used pip to install PyQt5. 我已经用venv创建了一个虚拟环境,并使用pip安装了PyQt5。 When I try any program that uses PyQt5, i get the following error: 当我尝试使用PyQt5的任何程序时,出现以下错误:

Fatal Python error: PyThreadState_Get: no current thread

I am using Python 3.6.0, Anaconda 64 bit, and have installed PyQt5 with pip (version 4.20), on Windows 7 64 bit. 我正在使用Python 3.6.0,Anaconda 64位,并在Windows 7 64位上安装了带有pip(版本4.20)的PyQt5。

MWE: MWE:

from PyQt5 import QtWidgets

I have confirmed this does work on my regular install. 我已经确认这可以正常安装。

you should install it using this command: 您应该使用以下命令进行安装:

conda install pyqt

And import it like: 并像这样导入:

import pyqt

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM