1. 工具包安装
pip install virtualenv | sudo apt-get install python-virtualenv
2. 创建虚拟环境
# virtualenv /system_python_bin_path /your_virenv_local_path
virtualenv -p /usr/bin/python2.7 /usr_local_path
# 创建链接
sudo ln -sf /usr_local_path/bin/activate tf_activate
sudo ldconfig -v
# 启动 虚拟环境:
source tf_activate
# "一顿操作,安装环境; 只在当前虚拟环境安装,不会影响系统环境下的 Python"
pip install tensorflow-gpu
pip install opencv-contrib-python
.....
#终止:
deactivate