快捷键打开终端,输入spyder
打开spyder工作界面
然后点击Tools——Preferences——Run——Console选择第二项
——python interpreter——select the Python interpreter for Spyder consoles——选择第二项use the following Python interpreter——然后在文件夹里面选择相对应的虚拟环境的python
我的是将
home/drl/anaconda3/bin/python
改为:
/home/drl/anaconda3/envs/tensorflow-gpu/bin/python
然后点击应用,再点击OK即可。
然后运行成功的截图如下所示: