使用 apt-get 或 pip 成功安装后软件包不可用

使用 apt-get 或 pip 成功安装后软件包不可用

我正在尝试在我的 Ubuntu 机器上安装一些库。以这个库为例 - virtualenv

ubuntu@ip-172-31-44-172:~$ sudo apt install virtualenv
Reading package lists... Done
Building dependency tree... 50%
Building dependency tree       
Reading state information... Done
virtualenv is already the newest version (15.0.1+ds-3ubuntu1).
The following package was automatically installed and is no longer required:
  libllvm4.0
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
ubuntu@ip-172-31-44-172:~$ 

但是现在当我尝试使用 virtualenv 时我得到了 -

ubuntu@ip-172-31-44-172:~$ virtualenv
The program 'virtualenv' is currently not installed. You can install it by typing:
sudo apt install virtualenv

“pip3”库也一样

ubuntu@ip-172-31-44-172:~$ sudo apt install python3-pip
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python3-pip is already the newest version (8.1.1-2ubuntu0.4).
The following package was automatically installed and is no longer required:
  libllvm4.0
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
ubuntu@ip-172-31-44-172:~$

ubuntu@ip-172-31-44-172:~$ pip3
The program 'pip3' is currently not installed. You can install it by typing:
sudo apt install python3-pip

这里的问题是什么?

答案1

我通过卸载并重新安装上述所有库解决了这个问题

sudo apt-get purge virtualenv
sudo apt-get purge python3-pip

然后我又重新安装了它们。我认为问题可能是——我将默认的 Python 版本从 2.7 更改为 3.5。

相关内容