Ubuntu16.04下安装tensorflow(CPU)spyder+pycharm

1.下载并安装Anaconda

1.1 下载

从Anaconda官网(https://www.continuum.io/downloads)上下载Linux版本

https://repo.continuum.io/archive/(推荐python3.5)

https://mirrors.tuna.tsinghua.edu.cn/tensorflow/linux/cpu/(清华大学开源软件镜像站)

1.2 安装

cd ~/Downloads(切换路径)

这里是以Anaconda2-5.0.1-Linux-x86_64.sh为例,Anaconda3同理

bash Anaconda2-5.0.1-Linux-x86_64.sh (这里下载了Python2.7的对应版本)

Welcome to Anaconda2 5.0.0.1

In order to continue the installation process, please review the license
agreement.
Please, press ENTER to continue
>>> 
===================================
Anaconda End User License Agreement
===================================

Copyright 2015, Anaconda, Inc.

All rights reserved under the 3-clause BSD License:

Redistribution and use in source and binary forms, with or without modification,
 are permitted provided that the following conditions are met:

  * Redistributions of source code must retain the above copyright notice, this 
list of conditions and the following disclaimer.
  * Redistributions in binary form must reproduce the above copyright notice, th
is list of conditions and the following disclaimer in the documentation and/or o
ther materials provided with the distribution.
  * Neither the name of Continuum Analytics, Inc. (dba Anaconda, Inc.) ("Continu
um") nor the names of its contributors may be used to endorse or promote product
s derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WA
RRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 IN NO EVENT SHALL CONTINUUM BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPE
CIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUR
EMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINES
S INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRA
CT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
 WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
 DAMAGE.


Notice of Third Party Software Licenses
=======================================

Anaconda contains open source software packages from third parties. These are av
ailable on an "as is" basis and subject to their individual license agreements. 
These licenses are available in Anaconda or at https://docs.anaconda.com/anacond
a/packages/pkg-docs . Any binary packages of these third party tools you obtain 
via Anaconda are subject to their individual licenses as well as the Anaconda li
cense. Continuum reserves the right to change which third party tools are provid
ed in Anaconda.

In particular, Anaconda contains re-distributable, run-time, shared-library file
s from the Intel(TM) Math Kernel Library ("MKL binaries"). You are specifically 
authorized to use the MKL binaries with your installation of Anaconda. You are a
lso authorized to redistribute the MKL binaries with Anaconda or in the conda pa
ckage that contains them. Use and redistribution of the MKL binaries are subject
 to the licensing terms located at https://software.intel.com/en-us/license/inte
l-simplified-software-license. If needed, instructions for removing the MKL bina
ries after installation of Anaconda are available at http://www.anaconda.com.

Anaconda also contains cuDNN software binaries from NVIDIA Corporation ("cuDNN b
inaries"). You are specifically authorized to use the cuDNN binaries with your i
nstallation of Anaconda. You are also authorized to redistribute the cuDNN binar
ies with an Anaconda package that contains them. If needed, instructions for rem
oving the cuDNN binaries after installation of Anaconda are available at http://
www.anaconda.com.


Cryptography Notice
===================

This distribution includes cryptographic software. The country in which you curr
ently reside may have restrictions on the import, possession, use, and/or re-exp
ort to another country, of encryption software. BEFORE using any encryption soft
ware, please check your country's laws, regulations and policies concerning the 
import, possession, or use, and re-export of encryption software, to see if this
 is permitted. See the Wassenaar Arrangement <http://www.wassenaar.org/> for mor
e information.

Continuum has self-classified this software as Export Commodity Control Number (
ECCN) 5D002.C.1, which includes information security software using or performin
g cryptographic functions with asymmetric algorithms. The form and manner of thi
s distribution makes it eligible for export under the License Exception ENC Tech
nology Software Unrestricted (TSU) exception (see the BIS Export Administration 
Regulations, Section 740.13) for both object code and source code. In addition, 
the Intel(TM) Math Kernel Library contained in Continuum's software is classifie
d by Intel(TM) as ECCN 5D992b with no license required for export to non-embargo
ed countries.

The following packages are included in this distribution that relate to cryptogr
aphy:

openssl
    The OpenSSL Project is a collaborative effort to develop a robust, commercia
l-grade, full-featured, and Open Source toolkit implementing the Transport Layer
 Security (TLS) and Secure Sockets Layer (SSL) protocols as well as a full-stren
gth general purpose cryptography library.

pycrypto
    A collection of both secure hash functions (such as SHA256 and RIPEMD160), a
nd various encryption algorithms (AES, DES, RSA, ElGamal, etc.).

pyopenssl
    A thin Python wrapper around (a subset of) the OpenSSL library.

kerberos (krb5, non-Windows platforms)
    A network authentication protocol designed to provide strong authentication 
for client/server applications by using secret-key cryptography.

cryptography
    A Python library which exposes cryptographic recipes and primitives.


Do you accept the license terms? [yes|no]
[no] >>> 
Please answer 'yes' or 'no':'
>>> yes

Anaconda2 will now be installed into this location:
/home/shawnee/anaconda2

  - Press ENTER to confirm the location
  - Press CTRL-C to abort the installation
  - Or specify a different location below

[/home/shawnee/anaconda2] >>> 
PREFIX=/home/shawnee/anaconda2
installing: python-2.7.13-heccc3f1_16 ...
Python 2.7.13 :: Anaconda, Inc.
installing: ca-certificates-2017.08.26-h1d4fec5_0 ...
installing: conda-env-2.6.0-h36134e3_1 ...
installing: intel-openmp-2018.0.0-h15fc484_7 ...
installing: libgcc-ng-7.2.0-hcbc56d2_1 ...
installing: libgfortran-ng-7.2.0-h6fcbd8e_1 ...
installing: libstdcxx-ng-7.2.0-h24385c6_1 ...
installing: expat-2.2.4-hc00ebd1_1 ...
installing: gmp-6.1.2-hb3b607b_0 ...
installing: graphite2-1.3.10-hc526e54_0 ...
installing: icu-58.2-h211956c_0 ...
installing: jbig-2.1-hdba287a_0 ...
installing: jpeg-9b-habf39ab_1 ...
installing: libffi-3.2.1-h4deb6c0_3 ...
installing: libsodium-1.0.13-h31c71d8_2 ...
installing: libssh2-1.8.0-h8c220ad_2 ...
installing: libtool-2.4.6-hd50d1a6_0 ...
installing: libxcb-1.12-he6ee5dd_2 ...
installing: lzo-2.10-hc0eb8fc_0 ...
installing: mkl-2018.0.0-hb491cac_4 ...
installing: ncurses-6.0-h06874d7_1 ...
installing: openssl-1.0.2l-h9d1a558_3 ...
installing: patchelf-0.9-hf79760b_2 ...
installing: pcre-8.41-hc71a17e_0 ...
installing: pixman-0.34.0-ha72d70b_1 ...
installing: tk-8.6.7-h5979e9b_1 ...
installing: unixodbc-2.3.4-hc36303a_1 ...
installing: xz-5.2.3-h2bcbf08_1 ...
installing: yaml-0.1.7-h96e3832_1 ...
installing: zlib-1.2.11-hfbfcf68_1 ...
installing: curl-7.55.1-hcb0b314_2 ...
installing: glib-2.53.6-hc861d11_1 ...
installing: hdf5-1.10.1-hb0523eb_0 ...
installing: libedit-3.1-heed3624_0 ...
installing: libpng-1.6.32-hda9c8bc_2 ...
installing: libtiff-4.0.8-h90200ff_9 ...
installing: libxml2-2.9.4-h6b072ca_5 ...
installing: mpfr-3.1.5-h12ff648_1 ...
installing: pandoc-1.19.2.1-hea2e7c5_1 ...
installing: readline-7.0-hac23ff0_3 ...
installing: zeromq-4.2.2-hb0b69da_1 ...
installing: dbus-1.10.22-h3b5a359_0 ...
installing: freetype-2.8-h52ed37b_0 ...
installing: gstreamer-1.12.2-h4f93127_0 ...
installing: libxslt-1.1.29-hcf9102b_5 ...
installing: mpc-1.0.3-hf803216_4 ...
installing: sqlite-3.20.1-h6d8b0f3_1 ...
installing: fontconfig-2.12.4-h88586e7_1 ...
installing: gst-plugins-base-1.12.2-he3457e5_0 ...
installing: alabaster-0.7.10-py27he5a193a_0 ...
installing: asn1crypto-0.22.0-py27h94ebe91_1 ...
installing: backports-1.0-py27h63c9359_1 ...
installing: backports_abc-0.5-py27h7b3c97b_0 ...
installing: beautifulsoup4-4.6.0-py27h3f86ba9_1 ...
installing: bitarray-0.8.1-py27h304d4c6_0 ...
installing: boto-2.48.0-py27h9556ac2_1 ...
installing: cairo-1.14.10-h58b644b_4 ...
installing: cdecimal-2.3-py27h4e63abe_1 ...
installing: certifi-2017.7.27.1-py27h9ceb091_0 ...
installing: chardet-3.0.4-py27hfa10054_1 ...
installing: click-6.7-py27h4225b90_0 ...
installing: cloudpickle-0.4.0-py27ha64365b_0 ...
installing: colorama-0.3.9-py27h5cde069_0 ...
installing: configparser-3.5.0-py27h5117587_0 ...
installing: contextlib2-0.5.5-py27hbf4c468_0 ...
installing: dask-core-0.15.2-py27heedc4a4_0 ...
installing: decorator-4.1.2-py27h1544723_0 ...
installing: docutils-0.14-py27hae222c1_0 ...
installing: enum34-1.1.6-py27h99a27e9_1 ...
installing: et_xmlfile-1.0.1-py27h75840f5_0 ...
installing: fastcache-1.0.2-py27h4cb8e01_0 ...
installing: filelock-2.0.12-py27h38fa839_0 ...
installing: funcsigs-1.0.2-py27h83f16ab_0 ...
installing: functools32-3.2.3.2-py27h4ead58f_1 ...
installing: futures-3.1.1-py27hdbc8cbb_0 ...
installing: glob2-0.5-py27hd3b7d1f_1 ...
installing: gmpy2-2.0.8-py27hc856308_1 ...
installing: greenlet-0.4.12-py27hac09c53_0 ...
installing: grin-1.2.1-py27h54abee7_1 ...
installing: heapdict-1.0.0-py27h33770af_0 ...
installing: idna-2.6-py27h5722d68_1 ...
installing: imagesize-0.7.1-py27hd17bf80_0 ...
installing: ipaddress-1.0.18-py27h337fd85_0 ...
installing: ipython_genutils-0.2.0-py27h89fb69b_0 ...
installing: itsdangerous-0.24-py27hb8295c1_1 ...
installing: jdcal-1.3-py27h2cc5433_0 ...
installing: jedi-0.10.2-py27h8af4e35_0 ...
installing: lazy-object-proxy-1.3.1-py27h682c727_0 ...
installing: locket-0.2.0-py27h73929a2_1 ...
installing: lxml-3.8.0-py27hb3ac1f5_0 ...
installing: markupsafe-1.0-py27h97b2822_1 ...
installing: mccabe-0.6.1-py27h0e7c7be_1 ...
installing: mistune-0.7.4-py27h6da7e90_0 ...
installing: mkl-service-1.1.2-py27hb2d42c5_4 ...
installing: mpmath-0.19-py27h4bb41bd_2 ...
installing: msgpack-python-0.4.8-py27hc2fa789_0 ...
installing: multipledispatch-0.4.9-py27h9b5f95a_0 ...
installing: numpy-1.13.1-py27hd1b6e02_2 ...
installing: olefile-0.44-py27h4bd3e3c_0 ...
installing: pandocfilters-1.4.2-py27h428e1e5_1 ...
installing: path.py-10.3.1-py27hc258cac_0 ...
installing: pep8-1.7.0-py27h444351c_0 ...
installing: pkginfo-1.4.1-py27hee1a9ad_1 ...
installing: ply-3.10-py27hd6d9ae5_0 ...
installing: psutil-5.2.2-py27h9b5ba61_0 ...
installing: ptyprocess-0.5.2-py27h4ccb14c_0 ...
installing: py-1.4.34-py27he5894e4_1 ...
installing: pycodestyle-2.3.1-py27h904819d_0 ...
installing: pycosat-0.6.2-py27h1cf261c_1 ...
installing: pycparser-2.18-py27hefa08c5_1 ...
installing: pycrypto-2.6.1-py27h9abbf5c_1 ...
installing: pycurl-7.43.0-py27hcf8ebea_3 ...
installing: pyflakes-1.5.0-py27hfba2528_1 ...
installing: pyodbc-4.0.17-py27h7f7627d_0 ...
installing: pyparsing-2.2.0-py27hf1513f8_1 ...
installing: pysocks-1.6.7-py27he2db6d2_1 ...
installing: pytz-2017.2-py27hcac29fa_1 ...
installing: pyyaml-3.12-py27h2d70dd7_1 ...
installing: pyzmq-16.0.2-py27h297844f_2 ...
installing: qt-5.6.2-h974d657_12 ...
installing: qtpy-1.3.1-py27h63d3751_0 ...
installing: rope-0.10.5-py27hcb0a616_0 ...
installing: ruamel_yaml-0.11.14-py27h672d447_2 ...
installing: scandir-1.5-py27h1c9e1f8_1 ...
installing: simplegeneric-0.8.1-py27h19e43cd_0 ...
installing: sip-4.18.1-py27he9ba0ab_2 ...
installing: six-1.10.0-py27hdcd7534_1 ...
installing: snowballstemmer-1.2.1-py27h44e2768_0 ...
installing: sortedcontainers-1.5.7-py27he59936f_0 ...
installing: sphinxcontrib-1.0-py27h1512b58_1 ...
installing: sqlalchemy-1.1.13-py27hb0a01da_0 ...
installing: subprocess32-3.2.7-py27h373dbce_0 ...
installing: tblib-1.3.2-py27h51fe5ba_0 ...
installing: toolz-0.8.2-py27hd3b1e7e_0 ...
installing: typing-3.6.2-py27h66f49e2_0 ...
installing: unicodecsv-0.14.1-py27h5062da9_0 ...
installing: wcwidth-0.1.7-py27h9e3e1ab_0 ...
installing: webencodings-0.5.1-py27hff10b21_1 ...
installing: werkzeug-0.12.2-py27hbf75dff_0 ...
installing: wrapt-1.10.11-py27h04f6869_0 ...
installing: xlrd-1.1.0-py27ha77178f_1 ...
installing: xlsxwriter-0.9.8-py27h260ecd4_0 ...
installing: xlwt-1.3.0-py27h3d85d97_0 ...
installing: babel-2.5.0-py27h20693cd_0 ...
installing: backports.shutil_get_terminal_size-1.0.0-py27h5bc021e_2 ...
installing: bottleneck-1.2.1-py27h21b16a3_0 ...
installing: cffi-1.10.0-py27hf1aaaf4_1 ...
installing: conda-verify-2.0.0-py27hf052a9d_0 ...
installing: cycler-0.10.0-py27hc7354d3_0 ...
installing: cytoolz-0.8.2-py27hf14aec9_0 ...
installing: entrypoints-0.2.3-py27h502b47d_2 ...
installing: h5py-2.7.0-py27h71d1790_1 ...
installing: harfbuzz-1.5.0-h2545bd6_0 ...
installing: html5lib-0.999999999-py27hdf15f34_0 ...
installing: llvmlite-0.20.0-py27_0 ...
installing: networkx-1.11-py27h7358325_0 ...
installing: nltk-3.2.4-py27h41293c3_0 ...
installing: numexpr-2.6.2-py27he5efce1_1 ...
installing: openpyxl-2.4.8-py27h9f0c937_1 ...
installing: packaging-16.8-py27h5e07c7c_1 ...
installing: partd-0.3.8-py27h4e55004_0 ...
installing: pathlib2-2.3.0-py27h6e9d198_0 ...
installing: pexpect-4.2.1-py27hcf82287_0 ...
installing: pillow-4.2.1-py27h7cd2321_0 ...
installing: pycairo-1.13.3-py27hea6d626_0 ...
installing: pyqt-5.6.0-py27h4b1e83c_5 ...
installing: python-dateutil-2.6.1-py27h4ca5741_1 ...
installing: pywavelets-0.5.2-py27hecda097_0 ...
installing: qtawesome-0.4.4-py27hd7914c3_0 ...
installing: scipy-0.19.1-py27h1edc525_3 ...
installing: setuptools-36.5.0-py27h68b189e_0 ...
installing: singledispatch-3.4.0.3-py27h9bcb476_0 ...
installing: sortedcollections-0.5.3-py27h135218e_0 ...
installing: sphinxcontrib-websupport-1.0.1-py27hf906f22_1 ...
installing: ssl_match_hostname-3.5.0.1-py27h4ec10b9_2 ...
installing: sympy-1.1.1-py27hc28188a_0 ...
installing: traitlets-4.3.2-py27hd6ce930_0 ...
installing: zict-0.1.2-py27hd58a209_0 ...
installing: backports.functools_lru_cache-1.4-py27he8db605_1 ...
installing: bleach-2.0.0-py27h3a0dcc8_0 ...
installing: clyent-1.2.2-py27h7276e6c_1 ...
installing: cryptography-2.0.3-py27hea39389_1 ...
installing: cython-0.26.1-py27hdbcff32_0 ...
installing: datashape-0.5.4-py27hf507385_0 ...
installing: get_terminal_size-1.0.0-haa9412d_0 ...
installing: gevent-1.2.2-py27h475ea6a_0 ...
installing: imageio-2.2.0-py27hf108a7f_0 ...
installing: isort-4.2.15-py27hcfa4749_0 ...
installing: jinja2-2.9.6-py27h82327ae_1 ...
installing: jsonschema-2.6.0-py27h7ed5aa4_0 ...
installing: jupyter_core-4.3.0-py27hcd9ae3a_0 ...
installing: navigator-updater-0.1.0-py27h0f9cd39_0 ...
installing: nose-1.3.7-py27heec2199_2 ...
installing: numba-0.35.0-np113py27_10 ...
installing: pandas-0.20.3-py27h820b67f_2 ...
installing: pango-1.40.11-hedb6d6b_0 ...
installing: patsy-0.4.1-py27hd1cf8c0_0 ...
installing: pickleshare-0.7.4-py27h09770e1_0 ...
installing: pygments-2.2.0-py27h4a8b6f5_0 ...
installing: pytables-3.4.2-py27ha79ee23_1 ...
installing: pytest-3.2.1-py27h98000ae_1 ...
installing: scikit-learn-0.19.0-py27hd893acb_2 ...
installing: testpath-0.3.1-py27hc38d2c4_0 ...
installing: tornado-4.5.2-py27h97b179f_0 ...
installing: wheel-0.29.0-py27h411dd7b_1 ...
installing: astroid-1.5.3-py27h8f8f47c_0 ...
installing: astropy-2.0.2-py27h57072c0_4 ...
installing: bkcharts-0.2-py27h241ae91_0 ...
installing: distributed-1.18.3-py27h5e7c565_0 ...
installing: flask-0.12.2-py27h6d5c1cd_0 ...
installing: jupyter_client-5.1.0-py27hbee1118_0 ...
installing: matplotlib-2.0.2-py27h334a7c2_1 ...
installing: nbformat-4.4.0-py27hed7f2b2_0 ...
installing: pip-9.0.1-py27h4c18a59_2 ...
installing: prompt_toolkit-1.0.15-py27h1b593e1_0 ...
installing: pyopenssl-17.2.0-py27h189ff3b_0 ...
installing: statsmodels-0.8.0-py27hc87d62d_0 ...
installing: terminado-0.6-py27h4be8df9_0 ...
installing: flask-cors-3.0.3-py27h1a8a27f_0 ...
installing: ipython-5.4.1-py27h36c99b6_1 ...
installing: nbconvert-5.3.1-py27he041f76_0 ...
installing: pylint-1.7.2-py27h77e98c6_0 ...
installing: seaborn-0.8.0-py27h9d2aaa1_0 ...
installing: urllib3-1.22-py27ha55213b_0 ...
installing: ipykernel-4.6.1-py27hc93e584_0 ...
installing: requests-2.18.4-py27hc5b0589_1 ...
installing: anaconda-client-1.6.5-py27hc8169bf_0 ...
installing: bokeh-0.12.7-py27he0197c9_1 ...
installing: conda-4.3.27-py27hff99c7a_0 ...
installing: jupyter_console-5.2.0-py27hc6bee7e_1 ...
installing: notebook-5.0.0-py27h3661c2b_2 ...
installing: qtconsole-4.3.1-py27hc444b0d_0 ...
installing: sphinx-1.6.3-py27hf9b1778_0 ...
installing: anaconda-project-0.8.0-py27hd7a9a97_0 ...
installing: conda-build-3.0.23-py27h7bd6724_0 ...
installing: dask-0.15.2-py27h7693082_0 ...
installing: jupyterlab_launcher-0.4.0-py27h0e16d15_0 ...
installing: numpydoc-0.7.0-py27h9647a75_0 ...
installing: widgetsnbextension-3.0.2-py27hcb77dec_1 ...
installing: anaconda-navigator-1.6.8-py27h2ea4365_0 ...
installing: ipywidgets-7.0.0-py27h4fda95d_0 ...
installing: jupyterlab-0.27.0-py27h42ebfef_2 ...
installing: odo-0.5.1-py27h9170de3_0 ...
installing: scikit-image-0.13.0-py27h06cb35d_1 ...
installing: spyder-3.2.3-py27hbf281d3_1 ...
installing: _ipyw_jlab_nb_ext_conf-0.1.0-py27h08a7f0c_0 ...
installing: blaze-0.11.3-py27h5f341da_0 ...
installing: jupyter-1.0.0-py27h505fd4b_0 ...
installing: anaconda-5.0.0.1-py27h1e3bc52_1 ...
installation finished.
Do you wish the installer to prepend the Anaconda2 install location
to PATH in your /home/shawnee/.bashrc ? [yes|no]
[no] >>> yes

Appending source /home/shawnee/anaconda2/bin/activate to /home/shawnee/.bashrc
A backup will be made to: /home/shawnee/.bashrc-anaconda2.bak


For this change to become active, you have to open a new terminal.

Thank you for installing Anaconda2!
View Code

一路选择 enter回车 或 输入yes!

这时在终端输入python显示的linux的发行版本,输入conda显示命令未知:

紧接着去配置Anaconda2的环境变量:

export PATH=/home/shawnee/anaconda2/bin:$PATH (加粗斜体部分需自行替换)

这时再次输入python:

输入conda:

也可查询conda信息:

到此 anaconda2 安装完成。

2.安装tensorflow

2.1 建立tensorflow运行环境

# Python 2.7  
$ conda create -n tensorflow python=2.7  
  
# Python 3.4  
$ conda create -n tensorflow python=3.4  
  
# Python 3.5  
$ conda create -n tensorflow python=3.5

2.2 在conda环境下安装tensorflow(conda安装方式只有CPU版本)

2.2.1 激活conda环境

$ source activate tensorflow

2.2.2 然后调用conda install 语句安装

# Linux/Mac OS X, Python 2.7/3.4/3.5, CPU only:

(tensorflow)$ conda install -c conda-forge tensorflow

2.2.3 上面的步骤完成后,从conda环境中退出

(tensorflow)$ source deactivate

2.3 测试安装是否成功

首先激活 tensorflow 环境,然后进入 python,最后导入 tensorflow 库。如果导入成功则表明安装成功。

当使用完毕后,关闭 tensorflow 环境。

当你需要再次使用的时候就必须再次激活 tensorflow 环境。

source activate tensorflow
......
......
关闭 tensorflow 环境,并重新激活

 

3.安装Spyder和Pycharm

 3.1 Spyder

为了使用spyder,需要在tensorflow环境下安装spyder:

shawnee@ubuntu:~/anaconda2$ source activate tensorflow
(tensorflow) shawnee@ubuntu:~/anaconda2$ conda install -n tensorflow spyder
Fetching package metadata ...........
Solving package specifications: .

Package plan for installation in environment /home/shawnee/anaconda2/envs/tensorflow:

The following NEW packages will be INSTALLED:

安装成功之后在tensorflow环境下运行spyder即可:

如果不在tensorflow环境下安装spyder,直接运行spyder时打开的可能不是tensorflow对应的python内核。

(tensorflow) shawnee@ubuntu:~/anaconda2$ source deactivate
shawnee@ubuntu:~/anaconda2$ source activate tensorflow

3.2 PyCharm

pycharm是目前使用最多的python IDE,界面简洁美观,安装简单.

下载pycharm

从官网(http://www.jetbrains.com/pycharm/download/#section=linux)下载Community版 for Linux。并将下载好的文件copy到想安装的目录下(我的为/home/shawnee/pycharm)。

安装pycharm

1)cd 到安装目录

cd home/shawnee/pycharm

2)解压缩(可手动解压缩)

tar xfz pycharm-community-2017.3.3.tar.gz

3)打开 pycharm.sh 文件所在目录

cd pycharm-community-2017.3.3/bin

4)安装

./pycharm.sh

接下来按照安装提示一步步继续就可以了。安装之后可通过charm命令打开。

 

参考博客:

http://blog.csdn.net/zzc15806/article/details/73662491(Ubuntu16.04下安装tensorflow(Anaconda3+pycharm+tensorflow+CPU))

https://www.cnblogs.com/zlslch/p/7975791.html(内含conda: command not found问题解决方法和pip方式安装tensorflow详细介绍)

https://www.cnblogs.com/Osler/p/7687170.html(内含安装spyder)

原文地址:https://www.cnblogs.com/exciting/p/8353980.html