我机器上pip freeze
的输出包含以下奇数行:
command-not-found==0.2.44
当尝试在不同的计算机上安装需求时,我得到了明显的No distributions at all found for command-not-found==0.2.44
。这是pip
错误吗?或者是否存在该名称的真正python包,pypi
中不存在?
答案 0 :(得分:1)
确实,正如后续评论中所提到的,Ubuntu有一个python包,通过dpkg / apt安装,名为" python-commandnotfound"
$apt-cache search command-not-found
command-not-found - Suggest installation of packages in interactive bash sessions
command-not-found-data - Set of data files for command-not-found.
python-commandnotfound - Python 2 bindings for command-not-found.
python3-commandnotfound - Python 3 bindings for command-not-found.
由于这是通过apt提供的,而pypi repo中没有提供,因此您无法通过pip安装它,但是pip会看到它已安装。为了显示已安装的软件包,如果通过apt,easy_install,pip,manual等安装软件包,pip并不关心。
简而言之,如果你真的需要在另一台主机(我认为你不是),你需要apt-get install python-commandnotfound
。