Tensorflow installation and related problem solving

 1. Install

the latest version of Anaconda-4.4.0 on the Anaconda official website and integrate python-3.6. However, as of now, tensorflow still cannot support 3.6, so we install Anaconda-4.2.0
that integrates python-3.5.  I recommend using Tsinghua University directly Download the provided image, and pay attention to selecting the corresponding system version.

Anaconda download address: 
https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/ After

downloading, directly open the file and install it. In the installation, you need to manually check and add the python environment (as shown below).

Check Add Anaconda to my PATH environment variable. 

After installation, we can
enter conda list on the command line (shortcut WIN key + R and then enter cmd)  to see which environments Anaconda has integrated for us. 
We can see that the environment contains numpy (a python scientific computing package that efficiently stores and processes large matrices), pandas (includes a large number of libraries and some standard data models, and provides the tools needed to efficiently manipulate large data sets) , And the easy-to-use package management tool pip.



Write the picture description here Write the picture description

here Write the picture description

here

If it shows that conda is not a command, the environment variable addition fails, and we need to manually add the environment variable. The method is to select advanced variable settings in the system panel, then select environment variables, and add three Anaconda paths to the path in the user variables, as shown in the figure.

Write picture description here
If it shows that conda is not a command, the environment variable addition fails, and we need to manually add environment variables. The method is to select advanced variable settings in the system panel, then select environment variables, and add three Anaconda paths to the path in the user variables, as shown in the figure.

2. Install tensorflow.

Use pip to automatically install tensorflow. 
pip install tensorflow

If you encounter the following red letter errors, you can see the prompt to update pip to a newer version (if you don't report an error, you can skip to the next topic). 
Update pip to the latest version 
pip -m pip install --upgrade pip 


After the update, you can see successfully installed pip-9.0.1, which means the pip update was successful. 

If you see the following red letter error, prompting that access to the folder is denied, it is because you did not open the command line as an administrator. Just open the command line as an administrator and install it again. 
Write the picture description here

and then we install tensorflow again. 
pip install tensorflow

3. Test whether the installation is successful.

Enter python into the python environment. 
Enter import tensorflow, if no error is reported in red, it means that the environment configuration is successful. 

4. Finally, if the installation is successful but an error occurs in python, it means that there is no keyword tensorflow

 

 Switch environment: activate tensorflow 

which environment you want to switch to. 
Since this article installs tensorflow, of course you must avtivate tensorflow! 
Little fairy! I'm coming! 

Guess you like

Origin blog.csdn.net/qq_38798147/article/details/79958006