今天我要装3个Tensorflow但是我发现每次装一个就卸载前面那个,我很奇怪,然后就发现了这个大问题!

问题描述

我是发现我which出来的pip和执行的pip不是同一个pip:

(tf1.12) ➜  TensorFlow2.0Tutorials-master which pip  
/home/zqh/miniconda3/envs/tf1.12/bin/pip
(tf1.12) ➜ TensorFlow2.0Tutorials-master pip --version
pip 19.0.3 from /home/zqh/.local/lib/python3.6/site-packages/pip (python 3.6)
让我很难受啊.

解决方案

直接卸载全局的pip! 然后都用虚拟环境.记得卸载前先关闭虚拟环境.

➜  gitio python3 -m pip uninstall pip
Uninstalling pip-19.0.3:
Would remove:
/home/zqh/.local/bin/pip
/home/zqh/.local/bin/pip3
/home/zqh/.local/bin/pip3.6
/home/zqh/.local/lib/python3.6/site-packages/pip-19.0.3.dist-info/*
/home/zqh/.local/lib/python3.6/site-packages/pip/*
Proceed (y/n)? y
➜ gitio sudo python3 -m pip uninstall pip