python的报错
目录
qt.qpa.plugin: Could not find the Qt platform plugin "windows" in "" This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fi x this problem.
无法从源解析导入 “xxxx” serial
import serial.tools ModuleNotFoundError: No module named 'serial.tools'
无法加载文件xxx,因为在此系统上禁止运行脚本
qt.qpa.plugin: Could not find the Qt platform plugin "windows" in "" This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fi x this problem.
一般安装了QT5的各种包就不需要安装QT了,他弹出这样的报错应该是QT的问题,这个勾吧软件它排斥中文,路径上一点中文都不能有,改你安装环境包所在的文件所在的各种文件夹的各种名字,不要一点中文就好了。
如果你的电脑用户名是中文,那恭喜你,和QT有关的一切都和你没关系。
无法从源解析导入 “xxxx” serial
去看你的python解释器路径对不对(博客里有怎么设置路径)
如果还不行,就检查你安装包的venv路径对不对,
如果还不行,那我也没招了,换电脑吧
import serial.tools ModuleNotFoundError: No module named 'serial.tools'
这个serial的包要按照顺序安2个包 才能使用第一个是 serial 第二个是pyserial (和python更新有关系)都安装了才可以跑这个工具
pip install serialpip install pyserial
测试安装
import serial
无法加载文件xxx,因为在此系统上禁止运行脚本
这个问题是系统策略的问题,你需要改一下系统策略
方法特别简单
搜索powershell以管理员方式运行 一定要搜索 ,其他的命令方式在我电脑上都不行
输入以下代码
set-ExecutionPolicy RemoteSigned
它会出现
然后Y就可以了
如果没出现就去尝试各种管理员方式打开命令终端的方法,输入这个代码