问题一:安装python3及修改默认python

检查系统默认指定Python版本:

python -V

安装python3:

sudo apt-get install python3

修改默认python:

sudo rm /usr/bin/python   #移除默认的python2.7

sudo ln -s /usr/bin/python3.6 /usr/bin/python   #指定python3.6为默认python

问题二:安装pip3及修改搜索源

sudo apt-get install python3-pip

检查版本:

pip3 -V

修改pip源为国内源:

mkdir .pip
cd .pip/
gedit pip.conf

在conf文件中添加:

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host=mirrors.aliyun.com

问题三:安装TensorFlow

下载Tensorflow:

https://github.com/lakshayg/tensorflow-build/releases

安装Tensorflow:

sudo pip3 --default-timeout=6000 install --ignore-installed --upgrade tensorflow-1.9.0-cp36-cp36m-linux_x86_64.whl 

安装软件包及相关依赖:

sudo pip3 install scipy scikit-image matplotlib pyyaml easydict cython munkres==1.0.12

参考链接:

https://blog.csdn.net/ViatorSun/article/details/82983401

https://blog.csdn.net/YangJimingX/article/details/86008309

Logo

CSDN联合极客时间,共同打造面向开发者的精品内容学习社区,助力成长!

更多推荐