安装了python3-pip但找不到pip3命令?

Modified on: Wed, 14 Nov 2018 15:00:02 +0800

我正在几台计算机上测试一个Python3程序。为此,我需要使用pip3安装Python库。

首先,我在每台计算机上安装python3-pip(每个人都在运行Kubuntu OS)。一切都很好,然后我用pip3安装了我需要的软件包,除了一台电脑,我设法做到了。

在那台计算机上,python3-pip显然是成功安装的,但是当我查找包时,我收到此错误(翻译是自制的):

找不到

Command «pip3» was not found, maybe you wanted to say:
 The command «pip» from the package «python-pip» (universe)
pip3: command not found

修改强>

dpkg -L python3-pip的结果:

/. /usr /usr/share /usr/share/man /usr/share/man/man1 /usr/share/man/man1/pip-3.2.1.gz /usr/share/doc /usr/share/doc/python3-pip /usr/share/doc/python3-pip/changelog.Debian.gz /usr/share/doc/python3-pip/copyright /usr/bin /usr/bin/pip-3.2 /usr/lib /usr/lib/python3 /usr/lib/python3/dist-packages /usr/lib/python3/dist-packages/pip /usr/lib/python3/dist-packages/pip/log.py /usr/lib/python3/dist-packages/pip/commands /usr/lib/python3/dist-packages/pip/commands/unzip.py /usr/lib/python3/dist-packages/pip/commands/zip.py /usr/lib/python3/dist-packages/pip/commands/install.py /usr/lib/python3/dist-packages/pip/commands/completion.py /usr/lib/python3/dist-packages/pip/commands/uninstall.py /usr/lib/python3/dist-packages/pip/commands/search.py /usr/lib/python3/dist-packages/pip/commands/freeze.py /usr/lib/python3/dist-packages/pip/commands/__init__.py /usr/lib/python3/dist-packages/pip/commands/help.py /usr/lib/python3/dist-packages/pip/commands/bundle.py /usr/lib/python3/dist-packages/pip/_pkgutil.py /usr/lib/python3/dist-packages/pip/util.py /usr/lib/python3/dist-packages/pip/status_codes.py /usr/lib/python3/dist-packages/pip/vcs /usr/lib/python3/dist-packages/pip/vcs/__init__.py /usr/lib/python3/dist-packages/pip/vcs/mercurial.py /usr/lib/python3/dist-packages/pip/vcs/git.py /usr/lib/python3/dist-packages/pip/vcs/bazaar.py /usr/lib/python3/dist-packages/pip/vcs/subversion.py /usr/lib/python3/dist-packages/pip/baseparser.py /usr/lib/python3/dist-packages/pip/exceptions.py /usr/lib/python3/dist-packages/pip/index.py /usr/lib/python3/dist-packages/pip/basecommand.py /usr/lib/python3/dist-packages/pip/req.py /usr/lib/python3/dist-packages/pip/locations.py /usr/lib/python3/dist-packages/pip/__init__.py /usr/lib/python3/dist-packages/pip/runner.py /usr/lib/python3/dist-packages/pip/backwardcompat.py /usr/lib/python3/dist-packages/pip/download.py /usr/lib/python3/dist-packages/pip-1.1.egg-info /usr/lib/python3/dist-packages/pip-1.1.egg-info/SOURCES.txt /usr/lib/python3/dist-packages/pip-1.1.egg-info/not-zip-safe /usr/lib/python3/dist-packages/pip-1.1.egg-info/top_level.txt /usr/lib/python3/dist-packages/pip-1.1.egg-info/PKG-INFO /usr/lib/python3/dist-packages/pip-1.1.egg-info/entry_points.txt /usr/lib/python3/dist-packages/pip-1.1.egg-info/dependency_links.txt

最佳答案

三件事之一可能会解决它:

  1. 如果python3-pip 正确安装,请重新安装:

    这用于基于Debian的发行版,如Ubuntu,Mint:

    sudo apt-get remove python3-pip; sudo apt-get install python3-pip
    

    如果使用Fedora,CentOS,RHEL,请使用:

    sudo dnf reinstall python3-pip
    
  2. 尝试使用命令python3-pip(适用于Fedora;我没有Kubuntu的副本来试用它)。

  3. 只是一个疯狂的猜测...检查pip --version。安装python3-pip后,新的pip替换旧的pip(可能是通过alternatives?)

  4. 醇>

    修改强>
    既然dpkg -L python3-pip的输出已添加到问题中,我可以提供答案。

    要使用的正确命令名是:pip-3.2


相关问答

添加新评论