0

我正在尝试将 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'

有什么想法可以让它工作吗?

4

0 回答 0