Ubuntu 认为 pip3 是最新版本但根本没有安装:如何解决?

Ubuntu 认为 pip3 是最新版本但根本没有安装:如何解决?

我遇到了一个奇怪的情况,我的 Ubuntu 16.04 坚持认为pip3已安装但又没有这样的文件pip3(请参阅底部的相关命令和输出)。

更奇怪的是,它pip3实际上似乎安装在Python 2.7小路:

$ /usr/local/bin/pip3 -V
pip 9.0.1 from /usr/local/lib/python2.7/dist-packages (python 3.5)

您能建议如何调试这种情况吗?


$ echo $PATH
/home/openstack/bin:/home/openstack/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
$ sudo apt install -y python3-pip --upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-pip is already the newest version (8.1.1-2ubuntu0.4).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
openstack@prclnx04:~/python/pybind11$ which pip3
/usr/local/bin/pip3
$ pip3 -V
-bash: /home/openstack/.local/bin/pip3: No such file or directory
openstack@prclnx04:~/python/pybind11$

相关内容