ipython console是什么,使用PyQt5设置IPython Qtconsole

On an OSX 10.9, I have Qt5 installed. Later I installed Ipython, sip and PyQt5 all build from source. Now here is the problem: when I try to run ipython qtconsole, I have a bunch of errors related to the files in this directory (and its subfolders)

/Library/Python/2.7/site-packages/IPython/

followed by

ImportError:

Could not load requested Qt binding. Please ensure that

PyQt4 >= 4.7 or PySide >= 1.0.3 is available,

and only one is imported per session.

Currently-imported Qt library: None

PyQt4 installed: False

PySide >= 1.0.3 installed: False

Tried to load: ['pyside', 'pyqt']

I assume the problem is that I have PyQt5 instead of PyQt4. Is this the problem or I have missed some thing else?

Is there anyway that I can have qtconsole with PyQt5? If no, what is the easiest way to do so? (preferably, a method that does not involve having two versions of Qt library on one machine).

For sake of brevity I skipped posting the full error message. Please let me know if I should add them from better understanding of the situation.

解决方案

The problem might be related to your python path.

I had almost the exact same problem. I had installed PyQt using Homebrew and I was getting the same error message. Finally what solved the problem was adding the following line to my .bash_profile:

export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH

Since I am a beginner myself, I can't help you any further but I hope this solves the problem.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值