ubuntu eric no module PyQt5.Qsci

家住魔仙堡 提交于 2020-06-04 02:55:51

问题


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:

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?

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?


回答1:


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

  1. I opened the terminal and wrote this command: pip3 install qscintilla.
  2. by above command my computer began to downloading qscintilla package, after downloading it start downloading pyqt5 and sip package.
  3. after step 2 I wrote this command: sudo apt-get remove eric.
  4. then I wrote this command: sudo apt-get install eric.
  5. after above steps I run eric by typing: eric and pressed Enter; then my eric ran successfully.



回答2:


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

From the Eric6 Technical Report

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.



来源:https://stackoverflow.com/questions/40573291/ubuntu-eric-no-module-pyqt5-qsci

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!