没有模块PyQt5.Qsci

时间:2021-04-14 23:09:14

Just installed Ubuntu 16.04 LTS yesterday, installed Eric. Worked fine. Wanted to start Eric and use qtdesigner today, didn't work (got error qtdesigner not found) since you have to manually install it according to guides. Went through that now this error:

昨天刚安装了Ubuntu 16.04 LTS,安装了Eric。工作得很好。今天想要启动Eric并使用qtdesigner,但是没有成功(没有找到错误qtdesigner),因为您必须根据指南手动安装它。经历了这个错误

Error in sys.excepthook:
Traceback (most recent call last):
File "<frozen importlib._bootstrap>", line 969, in _find_and_load
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 665, in exec_module
File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
File "/usr/share/eric/modules/Utilities/__init__.py", line 61, in <module>
from PyQt5.Qsci import QSCINTILLA_VERSION_STR, QsciScintilla
ImportError: No module named 'PyQt5.Qsci'

Original exception was:
Traceback (most recent call last):
File "/usr/share/eric/modules/eric6.py", line 326, in <module>
main()
File "/usr/share/eric/modules/eric6.py", line 240, in main
import Preferences
File "/usr/share/eric/modules/Preferences/__init__.py", line 36, in  <module>
from PyQt5.QtWebKit import QWebSettings
ImportError: No module named 'PyQt5.QtWebKit'

I already manually installed qscintilla, qt, pyqt, qtdesigner. What I have found is that under python3 there are distpackages containing pyqt4 and 5 (the ones missing according to the error) and I can import them when running python3 in the terminal. If I am running Python 2 that import isn't possible. I am assuming that eric uses Python2 to start and thus does not find these packages?

我已经手工安装了qscintilla, qt, pyqt, qtdesigner。我发现在python3下有包含pyqt4和5(根据错误丢失的)的distpackages,我可以在终端运行python3时导入它们。如果我正在运行python2,导入是不可能的。我假设eric使用Python2来启动而没有找到这些包?

I am very new to Linux and do not know if I am on the right track. I tried the solutions offered on the web, but the error just keeps coming up. Any suggestions?

我对Linux非常陌生,不知道自己是否走对了路。我尝试了网上提供的解决方案,但错误不断出现。有什么建议吗?

2 个解决方案

#1


1  

I have this problem (ImportError: No module named 'PyQt5.Qsci') and I solved it by these steps:

我有这个问题(ImportError:没有名为PyQt5.Qsci的模块),我通过以下步骤解决了这个问题:

  1. I opened the terminal and wrote this command: pip3 install qscintilla.
  2. 我打开终端并编写了以下命令:pip3安装qscintilla。
  3. by above command my computer began to downloading qscintilla package, after downloading it start downloading pyqt5 and sip package.
  4. 通过以上命令,我的电脑开始下载qscintilla包,下载后开始下载pyqt5和sip包。
  5. after step 2 I wrote this command: sudo apt-get remove eric.
  6. 在步骤2之后,我编写了这个命令:sudo apt-get remove eric。
  7. then I wrote this command: sudo apt-get install eric.
  8. 然后我编写了这个命令:sudo apt-get install eric。
  9. after above steps I run eric by typing: eric and pressed Enter; then my eric ran successfully.
  10. 在以上步骤之后,我通过输入:eric并按Enter运行eric;然后我的埃里克跑得很成功。

#2


0  

Just follow the instructions on Eric's download pages, and make sure you use python3 while executing the install.py script.

只需遵循Eric下载页面上的说明,并确保在执行安装时使用python3。py脚本。

From the Eric6 Technical Report

来自Eric6技术报告

Compatibility with Python ver. 3 or/and 2 From the current ver. 6, this same Eric IDE is fully Python 3 or/and 2 compatible, both considered as an executing program and as a developing environment. Indeed this same unique Eric IDE can be used with Python ver. 3 only, OR Python ver. 2 only, or Python ver. 3 AND ver. 2, together. This way offering a unique environment where to attenuate the inconveniences caused by such odd incompatibility between these two consecutive Python versions, and possibly easing the transition between them. That said, we have here decided to adopt and use Python ver. 3—and the consequently related accessories, such as primarily the related PyQt library—as the only base language for this Report 1 , and that for manifest reasons of manageability. Giving thus for granted that a fool-proof compatibility should be experienced in case of adoption of Python ver. 2.

与Python版本的兼容性。3或/和2从当前的ver。同样的Eric IDE是完全兼容的Python 3或/和2,两者都被认为是执行程序和开发环境。实际上,同样独特的Eric IDE也可以用于Python服务器。3 . only, OR Python ver。2 . only, or Python ver。3和版本。2、在一起。这种方式提供了一种独特的环境,在这种环境中,可以减少由于这两个连续的Python版本之间的这种奇怪的不兼容性所带来的不便,并可能减轻它们之间的转换。也就是说,我们已经决定采用和使用Python ver。3 -因此相关的附件,如主要相关的PyQt库,作为本报告1的唯一基础语言,并且出于可管理性的明显原因。因此,我们理所当然地认为,在采用Python ver时,应该体验到一种万无一失的兼容性。2。

#1


1  

I have this problem (ImportError: No module named 'PyQt5.Qsci') and I solved it by these steps:

我有这个问题(ImportError:没有名为PyQt5.Qsci的模块),我通过以下步骤解决了这个问题:

  1. I opened the terminal and wrote this command: pip3 install qscintilla.
  2. 我打开终端并编写了以下命令:pip3安装qscintilla。
  3. by above command my computer began to downloading qscintilla package, after downloading it start downloading pyqt5 and sip package.
  4. 通过以上命令,我的电脑开始下载qscintilla包,下载后开始下载pyqt5和sip包。
  5. after step 2 I wrote this command: sudo apt-get remove eric.
  6. 在步骤2之后,我编写了这个命令:sudo apt-get remove eric。
  7. then I wrote this command: sudo apt-get install eric.
  8. 然后我编写了这个命令:sudo apt-get install eric。
  9. after above steps I run eric by typing: eric and pressed Enter; then my eric ran successfully.
  10. 在以上步骤之后,我通过输入:eric并按Enter运行eric;然后我的埃里克跑得很成功。

#2


0  

Just follow the instructions on Eric's download pages, and make sure you use python3 while executing the install.py script.

只需遵循Eric下载页面上的说明,并确保在执行安装时使用python3。py脚本。

From the Eric6 Technical Report

来自Eric6技术报告

Compatibility with Python ver. 3 or/and 2 From the current ver. 6, this same Eric IDE is fully Python 3 or/and 2 compatible, both considered as an executing program and as a developing environment. Indeed this same unique Eric IDE can be used with Python ver. 3 only, OR Python ver. 2 only, or Python ver. 3 AND ver. 2, together. This way offering a unique environment where to attenuate the inconveniences caused by such odd incompatibility between these two consecutive Python versions, and possibly easing the transition between them. That said, we have here decided to adopt and use Python ver. 3—and the consequently related accessories, such as primarily the related PyQt library—as the only base language for this Report 1 , and that for manifest reasons of manageability. Giving thus for granted that a fool-proof compatibility should be experienced in case of adoption of Python ver. 2.

与Python版本的兼容性。3或/和2从当前的ver。同样的Eric IDE是完全兼容的Python 3或/和2,两者都被认为是执行程序和开发环境。实际上,同样独特的Eric IDE也可以用于Python服务器。3 . only, OR Python ver。2 . only, or Python ver。3和版本。2、在一起。这种方式提供了一种独特的环境,在这种环境中,可以减少由于这两个连续的Python版本之间的这种奇怪的不兼容性所带来的不便,并可能减轻它们之间的转换。也就是说,我们已经决定采用和使用Python ver。3 -因此相关的附件,如主要相关的PyQt库,作为本报告1的唯一基础语言,并且出于可管理性的明显原因。因此,我们理所当然地认为,在采用Python ver时,应该体验到一种万无一失的兼容性。2。