Install tf1.0 and tf1.5 in Anaconda environment --- py2.7
@ Wp20181030
Environment: ubuntu18.04, anaconda2. In ubuntu, python2.7.15 (default) and python3.6.5 are installed in advance ,.....
Here, we useAnaconda 2(Install it on your own ).Py2.7 and py3.5Environment,InstallTf1.0 and tf1.5, As follows:
Scenario 1: Install tf1.0 in py2.7.
# (1) create a test_py2 Environment [py2 + tf1.0]
Conda create-n <environment name, such as test_py2> Python = 2.7
# (2) activate the test_py2 environment for later use
Source activate test_py2
# Install TF
PIP install -- upgrade-installed tensorflow = 1.0
# Verify whether TF is successfully installed
$ Python
>>> Import tensorflow as TF
>>> TF. _ version __
>>> TF. _ path __
# Uninstall TF
PIP uninstall tensorflow
# (3) Exit the test_py2 Environment
Source deactivate test_py2
# (4) uninstall the test_py2 environment as needed
Conda remove-N test_py2 -- all
Scenario 2:Install tf1.5 in py3.5.
# (1) create a test_py3 Environment [py3 + tf1.5]
Conda create-n <environment name, such as test_py2> Python = 3.5
# (2) activate the environment for later use
Source activate test_py3
# Install TF
PIP install -- ignore-installed -- upgrade tensorflow-1.5.0-cp35-cp35m-manylinux1_x86_64.whl # manual download on the official website, TF and Py should match https://pypi.org/project/tensorflow/1.5.0/#files # The Python version corresponding to the downloaded tensorflow must match Conda create-N tensorflow Python = x. the version of X is the same.
# Verify whether TF is successfully installed
$ Python
>>> Import tensorflow as TF
>>> TF. _ version __
# Uninstall TF
PIP uninstall tensorflow
# (3) Exit the environment
Source deactivate test_py3
# (4) uninstall the environment as needed
Conda remove-N test_py3 -- all
Install tf1.0 and tf1.5 in Anaconda environment --- py2.7