试图嵌入IPython,但是stdin == None

时间:2013-09-14 05:39:25

标签: python ipython stdin blender

我试图将ipython嵌入到搅拌机中。 Blender与自己的python打包在一起,所以为了访问我自己的所有库,我从ipython3 sys.path变量中复制列表并执行:

import sys
for p in 
    sys.path.append(p)

import IPython
IPython embed

我收到以下错误:

>>> import IPython
>>> IPython.embed()
Traceback (most recent call last):
  File "<blender_console>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/IPython/frontend/terminal/embed.py", line 282, in embed
    _embedded_shell = InteractiveShellEmbed(**kwargs)
  File "/usr/lib/python3/dist-packages/IPython/frontend/terminal/embed.py", line 97, in __init__
    display_banner=display_banner
  File "/usr/lib/python3/dist-packages/IPython/frontend/terminal/interactiveshell.py", line 360, in __init__
user_module=user_module, custom_exceptions=custom_exceptions
  File "/usr/lib/python3/dist-packages/IPython/core/interactiveshell.py", line 455, in __init__
    self.init_readline()
  File "/usr/lib/python3/dist-packages/IPython/core/interactiveshell.py", line 1844, in init_readline
    self.refill_readline_hist()
  File "/usr/lib/python3/dist-packages/IPython/core/interactiveshell.py", line 1853, in refill_readline_hist
    stdin_encoding = sys.stdin.encoding or "utf-8"
AttributeError: 'NoneType' object has no attribute 'encoding'

我有什么想法可以让它发挥作用?

0 个答案:

没有答案