step1: Check if your Python environment is already configured:
python3 --version
pip3 --version
sudo apt update
sudo apt install python3-dev python3-pip
step2
: Install the TensorFlow pip package
pip3 install --user --upgrade tensorflow # install in $HOME
Verify the install:
python3 -c "import tensorflow as tf; tf.enable_eager_execution(); print(tf.reduce_sum(tf.random_normal([1000, 1000])))"
Python 3.6 ERROR:
from pip import main ImportError: cannot import name 'main'
SOLUTION:
vi /usr/bin/pip3
修改前
from pip import main
if __name__ == '__main__':
sys.exit(main())
修改后
from pip import __main__ //这行也要修改
if __name__ == '__main__':
sys.exit(__main__._main())//增加__main__._