python - 安装 PyReadline 后 "ValueError: _type_ ' v ' not supported"错误

标签 python linux python-2.7 ipython

我安装 PyReadline 后,IPython 将无法运行。当我卸载它时,它又开始工作了。

ipython 的堆栈跟踪:

(py2.7_monitor)[root@vm10-136-8-98 monitor]# ipython
WARNING: IPython History requires SQLite, your history will not be saved
Traceback (most recent call last):
  File "/home/py2.7_monitor/bin/ipython", line 11, in <module>
    sys.exit(start_ipython())
  File "/home/py2.7_monitor/lib/python2.7/site-packages/IPython/__init__.py", line 118, in start_ipython
    return launch_new_instance(argv=argv, **kwargs)
  File "/home/py2.7_monitor/lib/python2.7/site-packages/traitlets/config/application.py", line 591, in launch_instance
    app.initialize(argv)
  File "<string>", line 2, in initialize
  File "/home/py2.7_monitor/lib/python2.7/site-packages/traitlets/config/application.py", line 75, in catch_config_error
    return method(app, *args, **kwargs)
  File "/home/py2.7_monitor/lib/python2.7/site-packages/IPython/terminal/ipapp.py", line 314, in initialize
    self.init_shell()
  File "/home/py2.7_monitor/lib/python2.7/site-packages/IPython/terminal/ipapp.py", line 330, in init_shell
    ipython_dir=self.ipython_dir, user_ns=self.user_ns)
  File "/home/py2.7_monitor/lib/python2.7/site-packages/traitlets/config/configurable.py", line 380, in instance
    inst = cls(*args, **kwargs)
  File "/home/py2.7_monitor/lib/python2.7/site-packages/IPython/core/interactiveshell.py", line 531, in __init__
    self.init_readline()
  File "/home/py2.7_monitor/lib/python2.7/site-packages/IPython/core/interactiveshell.py", line 1941, in init_readline
    import IPython.utils.rlineimpl as readline
  File "/home/py2.7_monitor/lib/python2.7/site-packages/IPython/utils/rlineimpl.py", line 21, in <module>
    _rl = __import__(_rlmod_name)
  File "/home/py2.7_monitor/lib/python2.7/site-packages/readline.py", line 6, in <module>
    from pyreadline.rlmain import Readline
  File "/home/py2.7_monitor/lib/python2.7/site-packages/pyreadline/__init__.py", line 12, in <module>
    from . import logger, clipboard, lineeditor, modes, console
  File "/home/py2.7_monitor/lib/python2.7/site-packages/pyreadline/clipboard/__init__.py", line 13, in <module>
    from .win32_clipboard import GetClipboardText, SetClipboardText
  File "/home/py2.7_monitor/lib/python2.7/site-packages/pyreadline/clipboard/win32_clipboard.py", line 37, in <module>
    import ctypes.wintypes as wintypes
  File "/usr/local/lib/python2.7/ctypes/wintypes.py", line 23, in <module>
    class VARIANT_BOOL(_SimpleCData):
ValueError: _type_ 'v' not supported

最佳答案

As stated在他们的网站上,PyReadline 库用于 Windows

查看堆栈跟踪的最后几行:

import ctypes.wintypes as wintypes
File "/usr/local/lib/python2.7/ctypes/wintypes.py", line 23, in <module>
class VARIANT_BOOL(_SimpleCData):
ValueError: _type_ 'v' not supported

它试图从 ctypes 导入特定于 Windows 的数据类型,这显然是不可能的,因为您没有运行 Windows。

关于python - 安装 PyReadline 后 "ValueError: _type_ ' v ' not supported"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32608232/

相关文章:

python - Scikit-learn 随机森林袋外样本

c - Linux C - 获取锁定 key 状态'

python - 似乎无法打印出 "round 1. rounds 2, ext"

c - gettimeofday clock_gettime 生成唯一编号的解决方法

python - 在破折号后使用逗号但不反转时在正则表达式中得到 `bad character range`

python - 口是心非在 macOS 上不起作用,得到 : env: python2: No such file or directory

python - 如何在 Flask 中制作 RadioField?

Python:非阻塞+非失效进程

python - 如何将日期传递给 Python 中的脚本?

python - 令人难以置信的基本 lxml 问题 : getting HTML/string content of lxml. etree._Element?