Install tensorflow through anaconda python3.9 version under Windows10 and configure it to pycharm whole process installation tutorial

1. Install Anaconda

1. Download Anaconda from the official website https://www.anaconda.com/

insert image description here
insert image description here

2. After downloading Anaconda, first double-click the Anaconda installation package

insert image description here

3. Then click next until the following, you can customize the installation location

insert image description here

4. Then next step, both must be checked, then click Install and wait for the installation to complete.

insert image description here
So far, anaconda has been successfully installed.

2. Install tensorflow

1. Click the start menu, click anaconda prompt in anaconda3

insert image description here

2. First enter the command conda env list to detect which environments are currently installed. Normally, there is only one base (because I have installed it before, so there are three environments shown here, and the asterisk indicates the current environment);

insert image description here

3. Use the command conda create -n tensorflow python=3.7 and create a new virtual environment named tensorflow

4. Enter the TensorFlow environment, enter activate tensorflow in the command box of Anaconda Prompt, and enter the virtual environment created before; the preceding brackets indicate that you have entered the tensorflow environment

insert image description here

5. Enter the following command, conda search --full --name tensorflow to see which tensorflow versions are currently available;

insert image description here

6. Enter the following command, pip install tensorflow2.5.0 installs tensorflow, if you don't use the domestic mirror source, it will be slower. pip install tensorflow2.5.0 -i https://pypi.tuna.tsinghua.edu.cn/simple is to use the mirror, wait patiently for the installation to complete.

insert image description here

7. To check whether the installation is successful, first enter the python command, enter the python environment, then import import tensorflow as tf, and finally enter tf. version , if 2.5.0 is displayed, the installation has been successful.

insert image description here
The figure indicates that there is an error, and then copy the specified file (link: https://pan.baidu.com/s/1fpkXGqmQFkTuxlLH2teurw
extraction code: s64h ) to the path xxxx\Anaconda3\envs\tensorflow\Library\bin and find that The error has disappeared.
insert image description here

So far, if nothing else, tensorflow has been installed successfully.

3. Install and configure pycharm

1. Enter the URL https://www.jetbrains.com/pycharm/download/#section=windows to download the official pycharm installation package

insert image description here

2. Then double-click the installation package to install, configure as required, wait for the installation to complete, and then restart the computer.

insert image description here

3. After restarting the computer, open pycharm, create a new project, enter the project path, and set the environment variable to python.exe under the tensorflow you just installed

insert image description here
insert image description here

4. Create a new file, name it test.py, then enter the following code, save and run the code, indicating that pycharm has been successfully installed.

insert image description here
insert image description here
insert image description here

Four. Common errors and solutions

1. If your computer has opened the ladder that can access the external network, you must remember to close it, otherwise many inexplicable errors will be reported;

2. If an error of ImportError: DLL load failed: The specified module cannot be found is reported, it is generally due to the mismatch of the tensorflow version. After uninstalling the currently installed version, reinstall the new version.

five. appendix

Commands that may be used in the installation process
Create the python3.7.0 operating environment conda create -n tensorflow python=3.7.0
Activate the tensorflow environment conda activate tensorflow
Enter the python editing environment python
import tensorflow import tensorflow as tf
View the version of tensorflow tf. version
detection What environment variables are currently installed conda env list

Tags: Install tensorflow through anaconda python3.9 version under Windows10 and configure it to pycharm whole process installation tutorial

pycharm tensorflow python anaconda

Related: Install tensorflow through anaconda python3.9 version under Windows10 and configure it to pycharm whole process installation tutorial

Navigation
  1. 1. Install Anaconda
    1. 1. Download Anaconda from the official website https://www.anaconda.com/
    2. 2. After downloading Anaconda, first double-click the Anaconda installation package
    3. 3. Then click next until the following, you can customize the installation location
    4. 4. Then next step, both must be checked, then click Install and wait for the installation to complete.
  2. 2. Install tensorflow
    1. 1. Click the start menu, click anaconda prompt in anaconda3
    2. 2. First enter the command conda env list to detect which environments are currently installed. Normally, there is only one base (because I have installed it before, so there are three environments shown here, and the asterisk indicates the current environment);
    3. 3. Use the command conda create -n tensorflow python=3.7 and create a new virtual environment named tensorflow
    4. 4. Enter the TensorFlow environment, enter activate tensorflow in the command box of Anaconda Prompt, and enter the virtual environment created before; the preceding brackets indicate that you have entered the tensorflow environment
    5. 5. Enter the following command, conda search --full --name tensorflow to see which tensorflow versions are currently available;
    6. 6. Enter the following command, pip install tensorflow2.5.0 to install tensorflow, if you do not use the domestic mirror source, it will be slower. pip install tensorflow2.5.0 -i https://pypi.tuna.tsinghua.edu.cn/simple is to use the mirror, wait patiently to complete the installation.
    7. 7. To check whether the installation is successful, first enter the python command, enter the python environment, then import import tensorflow as tf, and finally enter tf.version, if 2.5.0 is displayed, the installation has been successful.
  3. 3. Install and configure pycharm
    1. 1. Enter the URL https://www.jetbrains.com/pycharm/download/#section=windows to download the official pycharm installation package
    2. 2. Then double-click the installation package to install, configure as required, wait for the installation to complete, and then restart the computer.
    3. 3. After restarting the computer, open pycharm, create a new project, enter the project path, and set the environment variable to python.exe under the tensorflow you just installed
    4. 4. Create a new file, name it test.py, then enter the following code, save and run the code, indicating that pycharm has been successfully installed.
  4. Four. Common errors and solutions
    1. 1. If your computer has opened the ladder that can access the external network, you must remember to close it, otherwise many inexplicable errors will be reported;
    2. 2. If an error of ImportError: DLL load failed: The specified module cannot be found is reported, it is generally due to the mismatch of the tensorflow version. After uninstalling the currently installed version, reinstall the new version.
  5. five. appendix