我出现这个问题是在容器中使用Python时出现的,容器中默认安装有Python2和Python3,可直接通过在命令行输入python或者python3来验证自己的容器中是否装有python2.x和python3.x的环境。
但在容器中运行pip list或者是pip3 list时会出现**-bash: pip3: command not found**的问题,此时可通过安装pip来解决。
安装python2.x的pip:
apt-get install python-pip
安装python3.x的pip:
apt-get install python3-pip
安装完成后,就可以使用pip list或者pip3 list了