1、安装Python 3.5以及tensorflow
以前用virtualenv觉得挺好用了,但是用多python版本下安装tensorflow,出现问题:
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available. Collecting flask Could not fetch URL https://pypi.python.org/simple/flask/: There was a problem confirming the ssl certificate: Can't connect to HTTPS URL because the SSL module is not available. - skipping Could not find a version that satisfies the requirement flask (from versions: ) No matching distribution found for flask
查看很多资料,参考,参考2,按照一些方式仍然不行,选择anaconda安装,很方便。
在次环境中安装tensorflow:
conda create --name python35 python=3.5(用3.6与pip安装的tensorflow不兼容)
source activate python35
pip install --upgrade tensorflow
2、回退Python 2.7
如果要退出Python 3.5环境,输入
source deactivate python35
可以看到系统退回Python 2.7环境