简体   繁体   English

为什么 PyQt5 导入显示有关 windows 和蓝牙的错误?

[英]Why PyQt5 import show a error about windows and bluetooth?

The import of PyQt5 come with this error: PyQt5 的导入带有此错误:

C:\Python364>python.exe
Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:54:40) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from PyQt5.Qt import *

错误 PyQt5,Windows,蓝牙

If I used the normal import of python module PyQt5, this error doesn't show:如果我使用python模块PyQt5的正常导入,则不会显示此错误:

C:\Python364>python.exe
Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:54:40) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import PyQt5
>>> from PyQt5 import *
>>>

The question addresses several issues related to:该问题涉及与以下相关的几个问题:

  • Python integrity; Python完整性;
  • the integrity of the PyQt5 mode; PyQt5模式的完整性;
  • the integrity of the Windows 8.1 operating system; Windows 8.1 操作系统的完整性;

Is that normal to happen?出现这种情况正常吗?

Check this: https://doc-snapshots.qt.io/qt5-5.9/qtbluetooth-index.html检查这个: https : //doc-snapshots.qt.io/qt5-5.9/qtbluetooth-index.html

The Bluetooth API implemented into PyQt5 does not support Windows (yet?). PyQt5 中实现的蓝牙 API 不支持 Windows(还没有?)。

Importing PyQt5.Qt also imports the Bluetooth API of Qt - either downgrade to 5.9 (dont know at what point exactly this happens, but 5.9 and lower should be prior to the implementation) or specify your import.导入 PyQt5.Qt 也会导入 Qt 的蓝牙 API - 要么降级到 5.9(不知道这到底发生在什么时候,但 5.9 及更低版本应该在实现之前)或指定您的导入。

Had same problem.有同样的问题。 Also currently qt 5.9 no more available in PIP.目前 qt 5.9 在 PIP 中不再可用。

In my case just renamed file C:\\Python\\Python38-32\\Lib\\site-packages\\PyQt5\\Qt\\bin\\Qt5Bluetooth.dll to _Qt5Bluetooth.dll在我的情况下,刚刚将文件C:\\Python\\Python38-32\\Lib\\site-packages\\PyQt5\\Qt\\bin\\Qt5Bluetooth.dll_Qt5Bluetooth.dll

No bluetooth dll, no problem :)没有蓝牙dll,没问题:)

Python 3. First of all, make sure that Python 3 is available on your system. Python 3。首先,确保您的系统上有 Python 3。

Install Xcode and command-line tools.安装 Xcode 和命令行工具。 If you are using OS X, download Xcode and install it.如果您使用的是 OS X,请下载 Xcode 并安装它。 Install Qt Libraries.安装 Qt 库。 Create a virtualenv for the PyQt5 and SIP libs.为 PyQt5 和 SIP 库创建一个 virtualenv。 Install SIP.安装 SIP。 Install PyQt5.安装 PyQt5。 All Done!全部完成!

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

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