Ubuntu18.04 installation anaconda and tensorflow

First, install anaconda
from Tsinghua mirror sites to download their favorite version corresponding to anaconda, (my own case are the latest, because I prefer to date, little OCD ......) as shown in (click Anaconda3-5.3.1 -Linux-x86_64.sh, download the file):
Here Insert Picture Descriptionenter the folder where the file, run the sh command:

sudo sh Anaconda3-5.3.1-Linux-x86_64.sh

Start the installation, the installation progress among the best looking (not long), because the installation finally inquiry is not necessary to have a route added to the .bashrc file, the default is [no].
Pirates because I did not cut down ......
a very short time will automatically select the default, and then continue with the installation, the installation finished had to add their own path, of course, if you miss .bashrc file can be opened in the terminal to add their own (such as home run command and then to file At last):


 1. sudo gedit ~/.bashrc
 2. export PATH="/home/cat/anaconda3/bin:$PATH"export PATH="/home/cat/anaconda3/bin:$PATH"

Description: cat is the host name of the landlord, when you add a host name with its own
installation is complete! You can test to see whether the input python anaconda in the terminal
Here Insert Picture Descriptioninstallation is now complete! ! !
Second, the installation tensorflow
landlord recommended pip installed because installation with conda to choose their own version, do not know the election, not as a direct pip install the latest.
Installed base can be used, and can be tested with the following code:


 1. from tensorflow.python.client import device_lib
 2. device_lib.list_local_devices()device_lib.list_local_devices()

If appears as shown, it is successful.
Here Insert Picture DescriptionOf course pip install if you do not specify a source, it is necessary to open the VPN, if no VPN, Tsinghua recommended source.

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package

If conda installed, you can view other people's blog, many people are very detailed, I do not long-winded friends.

Released nine original articles · won praise 2 · Views 3086

Guess you like

Origin blog.csdn.net/xiaokan_001/article/details/88133162