Anaconda+tensorflow installation complete steps
anaconda install tensorflow
1. Install anaconda
Download anaconda from the official website ( https://www.anaconda.com/products/distribution )
2. Download the windows version to download and install
3. Open Anaconda Prompt
(1) Check whether the anaconda environment is installed successfully
conda --version
(2) Detect which environment variables are currently installed:
conda info –-envs
(3) Install a supporting python in anaconda and create a tensorflow environment
conda create -n TF2 python==3.9
(TF2 is named by itself)
and then enter y
4. Install tensorflow
(1) Use the activate TF2 (same name as the environment you just created) command to open the newly created tensorflow environment
activate TF2
If you exit the tensorflow environment:
deactivate
(2) Input command
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow
5. Test
python
import tensorflow as tf
tf.__version__
PyCharm download and installation
1. Download the pycharm community version from the official website
pycharm windows version download address: https://www.jetbrains.com/pycharm/download/#section=windows
2. PyCharm environment configuration
3. Test
import tensorflow as tf
tensorflow_version = tf.__version__
gpu_avilable = tf.test.is_gpu_available()
print("tensorflow version: ", tensorflow_version,"\tGPU aviable:", gpu_avilable)
a = tf.constant([1.0,2.0], name = 'a')
b = tf.constant([1.0,2.0], name = 'b')
result = tf.add(a,b,name='add')
print(result)
Result:
If tensorflow is not successfully installed in acanoda, install it in pycharm.
Click on File-settings