首页 > 解决方案 > ModuleNotFoundError:没有名为“readline”的模块

问题描述

tushar@tushar:~/ghost$ sudo ghost
[sudo] password for tushar: 

Traceback (most recent call last):
  File "./ghost", line 9, in <module>
    import readline
ModuleNotFoundError: No module named 'readline'

这里再试一次。

tushar@tushar:~/ghost$ 
tushar@tushar:~/ghost$ sudo ghost
Traceback (most recent call last):
  File "./ghost", line 9, in <module>
    import readline
ModuleNotFoundError: No module named 'readline'
tushar@tushar:~/ghost$ 

我收到此错误,但我已经安装了 readline ...

tushar@tushar:~$ pip install readline
/usr/share/python-wheels/pkg_resources-0.0.0-py3-none-any.whl/pkg_resources/py2_warn.py:21: UserWarning: Setuptools will stop working on Python 2

您正在 Python 2 上运行 Setuptools,该版本不再受支持,并且 SETUPTOOLS 将在后续版本(不早于 2020-04-20)中停止工作。请确保您setuptools<45在您的环境中使用 pip 9.x 或更高版本或 pin 安装 Setuptools。如果您已经完成了这些操作并且仍然遇到此消息,请在

警告:旧脚本包装器正在调用 pip。这将在 pip 的未来版本中失败。请参阅 https://github.com/pypa/pip/issues/5599以获取有关解决潜在问题的建议。为避免此问题,您可以使用“-m pip”调用 Python,而不是直接运行 pip。弃用:Python 2.7 已于 2020 年 1 月 1 日结束其生命周期。请升级您的 Python,因为不再维护 Python 2.7。未来版本的 pip 将不再支持 Python 2.7。有关 pip 中 Python 2 支持的更多详细信息, 请参见https://pip.pypa.io/en/latest/development/release-process/#python-2-support 已满足要求:.​​/.local/ 中的 readline lib/python2.7/site-packages (6.2.4.1) tushar@tushar:~$

标签: python

解决方案


推荐阅读