python - torbrowser-launcher 因导入 QtCore 而失败
问题描述
使用产品torbrowser-launcher
在 Fedora 33 上安装和启动Python 3.9.6
Traceback (most recent call last):
File "/usr/bin/torbrowser-launcher", line 29, in <module>
import torbrowser_launcher
File "/usr/lib/python3.9/site-packages/torbrowser_launcher/__init__.py", line 34, in <module>
from PyQt5 import QtCore, QtWidgets
ImportError: cannot import name 'QtCore' from 'PyQt5' (unknown location)
在检查了如何torbrowser-launcher
从/usr/bin/torbrowser-launcher
第一行启动之后
#!/usr/bin/python3 -s
我能够在交互式解释器中重现这一点
/usr/bin/python3 -s
Python 3.9.6 (default, Jul 16 2021, 00:00:00)
[GCC 11.1.1 20210531 (Red Hat 11.1.1-3)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from PyQt5 import QtCore, QtWidgets
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name 'QtCore' from 'PyQt5' (unknown location)
>>>
但是,离开-s
标志后,这意味着
-s Don't add user site directory to sys.path.
它工作得很好
/usr/bin/python3
Python 3.9.6 (default, Jul 16 2021, 00:00:00)
[GCC 11.1.1 20210531 (Red Hat 11.1.1-3)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from PyQt5 import QtCore, QtWidgets
>>>
如何解决此问题并启动torbrowser-launcher
?
解决方案
推荐阅读
- jenkins - 使用 naginator-plugin 在 Jenkins 中重试失败作业时如何保持相同的节点
- ios - 如何从情节提要中从 xib 到视图控制器?
- reactjs - 无法将“已连接”的 HOC 与反应路由器一起使用
- python - 我的程序不断发送垃圾邮件打印功能 Python
- node.js - 如何在 Node.js 中构建一个类来抽象 RabbitMQ 和 amqplib 功能
- java - 没有参数的 super() 关键字
- rust - 将 &i64 转换为 &[u8; 的惯用方法是什么?8]?
- makefile - Vala 的 Makefile
- laravel-5 - 如果 \Log::info 的输出取决于某些选项?
- javascript - 有没有办法让嵌套循环使用与循环相同的计数器?