tensorflow的安装

安装tensor flow真的好坑

本人Mac,但是不是nividna的显卡,所以装不了g pu版本的,虽然自己电脑也带g pu。

起初遇到的坑:

conda list
# packages in environment at /Users/apple/anaconda3:
#
# Name                    Version                   Build  Channel
_ipyw_jlab_nb_ext_conf    0.1.0                    py37_0  
_tflow_select             2.3.0                       mkl  
absl-py                   0.9.0                    py37_0  
alabaster                 0.7.11                   py37_0  
anaconda                  5.3.1                    py37_0  
anaconda-client           1.7.2                    py37_0  
tblib                     1.3.2                    py37_0  
tensorboard               2.0.0              pyhb38c66f_1  
tensorflow                2.0.0           mkl_py37hda344b4_0  
tensorflow-estimator      2.0.0              pyh2649769_0  
termcolor                 1.1.0                    py37_1  
terminado                 0.8.1                    py37_1  
testpath                  0.3.1                    py37_0  
#这里是从a到z排列的就显示这些了

安装了tensor flow2.0.0版本,但是就是不对

这是conda的环境

conda info -e
# conda environments:
#
base                  *  /Users/apple/anaconda3
tensorflow-gpu           /Users/apple/anaconda3/envs/tensorflow-gpu

把环境启一下

(base) appledeMBP-5:~ apple$ conda activate tensorflow-gpu
(tensorflow-gpu) appledeMBP-5:~ apple$ conda list
# packages in environment at /Users/apple/anaconda3/envs/tensorflow-gpu:
#

可以看到前面()里变成tensor flow-gpu的环境了

看了一下有木有nvidia显卡

(tensorflow-gpu) appledeMBP-5:~ apple$ nvidia-smi
-bash: nvidia-smi: command not found

我是木有的,那还装个gpu版本的毛线,所以直接全部删掉吧

先把环境从激活状态退出

然后再全部删

(tensorflow-gpu) appledeMBP-5:~ apple$ conda deactivate
(base) appledeMBP-5:~ apple$ conda remove -n tensorflow-gpu -all
usage: conda [-h] [-V] command ...
conda: error: unrecognized arguments: -all
(base) appledeMBP-5:~ apple$ conda remove -n tensorflow-gpu --all

Remove all packages in environment /Users/apple/anaconda3/envs/tensorflow-gpu:

全部删完后建一个tensor flow的环境,装CPU的,注意这里最好指定python的版本,要不可能老出错,tensorflow2支持的python版本有限,最好先查一下

(base) appledeMBP-5:~ apple$ conda create -n tensorflow python=3.6

完成之后看一下有哪几个环境啦

(base) appledeMBP-5:~ apple$ conda info -e
# conda environments:
#
base                  *  /Users/apple/anaconda3
tensorflow               /Users/apple/anaconda3/envs/tensorflow

没错,有了。

再激活一下。

激活完了就要安装tensor flow喽。指定版本啦,而且我用pip安装老是出错,但是用conda就没错了,而且记得提前安装好anaconda。

出错了请注意:

(base) appledeMBP-5:~ apple$ conda activate tensorflow
(tensorflow) appledeMBP-5:~ apple$ conda install tensorflow=2.1
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.

PackagesNotFoundError: The following packages are not available from current channels:

如果出现

CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.

这样解决就好了

# 激活环境
source activate
# 退出环境
source deactivate

再瞅瞅

(tensorflow) appledeMBP-5:~ apple$ conda config --show
add_anaconda_token: True
add_pip_as_python_dependency: True
aggressive_update_packages:
  - ca-certificates
  - certifi
  - openssl
allow_conda_downgrades: False
allow_cycles: True
allow_non_channel_urls: False

再来

配置一下源

(tensorflow) appledeMBP-5:~ apple$ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
(tensorflow) appledeMBP-5:~ apple$ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
(tensorflow) appledeMBP-5:~ apple$ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch
(tensorflow) appledeMBP-5:~ apple$ conda config --set show_channel_urls yes
(tensorflow) appledeMBP-5:~ apple$ conda install tensorflow=2.1
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.

PackagesNotFoundError: The following packages are not available from current channels:
(tensorflow) appledeMBP-5:~ apple$ conda install tensorflow=2.0
Collecting package metadata (repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /Users/apple/anaconda3/envs/tensorflow

  added / updated specs:
    - tensorflow=2.0


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    _tflow_select-2.3.0        |              mkl           3 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
(tensorflow) appledeMBP-5:~ apple$ python
Python 3.6.10 |Anaconda, Inc.| (default, May  7 2020, 23:06:31) 
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> tf.__version__
'2.0.0'
>>> tf.keras.__version__
'2.2.4-tf'
>>> exit()

成功了

😄

上面import tensorflow的时候有时候会报错:

如no module named six:

conda安装时又显示已经安装过了,说明是系统没有引到某个路径:

另外我们在安装一些包的时候遇到的问题:

(tensorflow) appledeMBP-5:~ apple$ pip3 install tplotlib
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
^[[AERROR: Could not find a version that satisfies the requirement tplotlib (from versions: none)
ERROR: No matching distribution found for tplotlib
(tensorflow) appledeMBP-5:~ apple$ pip3 install matplotlib
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting matplotlib
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/0d/61/b741990b429341bac1af5f5c645ee7aaa3bbe7daf3418d283c92c4b5ee82/matplotlib-3.2.1-cp37-cp37m-macosx_10_9_x86_64.whl (12.4 MB)
Collecting cycler>=0.10
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/f7/d2/e07d3ebb2bd7af696440ce7e754c59dd546ffe1bbe732c8ab68b9c834e61/cycler-0.10.0-py2.py3-none-any.whl (6.5 kB)
Collecting python-dateutil>=2.1


ERROR: traitlets 4.3.3 requires decorator, which is not installed.
ERROR: keras-applications 1.0.8 requires h5py, which is not installed.
ERROR: ipython 7.13.0 requires decorator, which is not installed.
Installing collected packages: six, cycler, python-dateutil, kiwisolver, numpy, pyparsing, matplotlib
Successfully installed cycler-0.10.0 kiwisolver-1.2.0 matplotlib-3.2.1 numpy-1.18.5 pyparsing-2.4.7 python-dateutil-2.8.1 six-1.15.0

pip安装个包都给报错,实在是气人

(tensorflow) appledeMBP-5:~ apple$ conda install matplotlib
Collecting package metadata (repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /Users/apple/anaconda3/envs/tensorflow

  added / updated specs:
    - matplotlib

pip 不行的时候试一下conda,但是还是推荐用pip,因为conda里面的包不全

 

最后附上我整个傻逼的过程吧

Last login: Mon Jun  8 13:01:32 on console
(base) appledeMBP-5:~ apple$ conda list
# packages in environment at /Users/apple/anaconda3:
#
# Name                    Version                   Build  Channel
_ipyw_jlab_nb_ext_conf    0.1.0                    py37_0  
_tflow_select             2.3.0                       mkl  
absl-py                   0.9.0                    py37_0  
alabaster                 0.7.11                   py37_0  
anaconda                  5.3.1                    py37_0  
anaconda-client           1.7.2                    py37_0  
anaconda-navigator        1.9.2                    py37_0  
anaconda-project          0.8.2                    py37_0  
appdirs                   1.4.3            py37h28b3542_0  
appnope                   0.1.0                    py37_0  
appscript                 1.0.1            py37h1de35cc_1  
asn1crypto                0.24.0                   py37_0  
astor                     0.8.0                    py37_0  
astroid                   2.0.4                    py37_0  
astropy                   3.0.4            py37h1de35cc_0  
atomicwrites              1.2.1                    py37_0  
attrs                     18.2.0           py37h28b3542_0  
automat                   0.7.0                    py37_0  
babel                     2.6.0                    py37_0  
backcall                  0.1.0                    py37_0  
backports                 1.0                      py37_1  
backports.shutil_get_terminal_size 1.0.0                    py37_2  
bcrypt                    3.1.7            py37h1de35cc_0  
beautifulsoup4            4.6.3                    py37_0  
bitarray                  0.8.3            py37h1de35cc_0  
bkcharts                  0.2                      py37_0  
blas                      1.0                         mkl  
blaze                     0.11.3                   py37_0  
bleach                    2.1.4                    py37_0  
blosc                     1.14.4               hd9629dc_0  
bokeh                     0.13.0                   py37_0  
boto                      2.49.0                   py37_0  
bottleneck                1.2.1            py37h1d22016_1  
bzip2                     1.0.6                h1de35cc_5  
c-ares                    1.15.0            h1de35cc_1001  
ca-certificates           2020.1.1                      0  
certifi                   2020.4.5.1               py37_0  
cffi                      1.11.5           py37h6174b99_1  
chardet                   3.0.4                    py37_1  
click                     6.7                      py37_0  
cloudpickle               0.5.5                    py37_0  
clyent                    1.2.2                    py37_1  
colorama                  0.3.9                    py37_0  
conda                     4.8.3                    py37_0  
conda-build               3.15.1                   py37_0  
conda-env                 2.6.0                         1  
conda-package-handling    1.6.1            py37h1de35cc_0  
constantly                15.1.0           py37h28b3542_0  
contextlib2               0.5.5                    py37_0  
cryptography              2.9.2            py37ha12b0ac_0  
curl                      7.67.0               ha441bb4_0  
cycler                    0.10.0                   py37_0  
cython                    0.28.5           py37h0a44026_0  
cytoolz                   0.9.0.1          py37h1de35cc_1  
dask                      0.19.1                   py37_0  
dask-core                 0.19.1                   py37_0  
datashape                 0.5.4                    py37_1  
dbus                      1.13.2               h760590f_1  
decorator                 4.3.0                    py37_0  
defusedxml                0.5.0                    py37_1  
distributed               1.23.1                   py37_0  
docutils                  0.14                     py37_0  
entrypoints               0.2.3                    py37_2  
et_xmlfile                1.0.1                    py37_0  
expat                     2.2.6                h0a44026_0  
fastcache                 1.0.2            py37h1de35cc_2  
filelock                  3.0.8                    py37_0  
flask                     1.0.2                    py37_1  
flask-cors                3.0.6                    py37_0  
freetype                  2.9.1                hb4e5f40_0  
gast                      0.2.2                    py37_0  
get_terminal_size         1.0.0                h7520d66_0  
gettext                   0.19.8.1             h15daf44_3  
gevent                    1.3.6            py37h1de35cc_0  
glib                      2.56.2               hd9629dc_0  
glob2                     0.6                      py37_0  
gmp                       6.1.2                hb37e062_1  
gmpy2                     2.0.8            py37h6ef4df4_2  
google-pasta              0.2.0                      py_0  
greenlet                  0.4.15           py37h1de35cc_0  
grpcio                    1.16.1           py37h044775b_1  
h5py                      2.8.0            py37h878fce3_3  
hdf5                      1.10.2               hfa1e0ec_1  
heapdict                  1.0.0                    py37_2  
html5lib                  1.0.1                    py37_0  
hyperlink                 18.0.0                   py37_0  
icu                       58.2                 h4b95b61_1  
idna                      2.7                      py37_0  
imageio                   2.4.1                    py37_0  
imagesize                 1.1.0                    py37_0  
incremental               17.5.0                   py37_0  
intel-openmp              2019.0                      118  
ipykernel                 4.9.0                    py37_1  
ipython                   6.5.0                    py37_0  
ipython_genutils          0.2.0                    py37_0  
ipywidgets                7.4.1                    py37_0  
isort                     4.3.4                    py37_0  
itsdangerous              0.24                     py37_1  
jbig                      2.1                  h4d881f8_0  
jdcal                     1.4                      py37_0  
jedi                      0.12.1                   py37_0  
jinja2                    2.10                     py37_0  
jpeg                      9b                   he5867d9_2  
jsonschema                2.6.0                    py37_0  
jupyter                   1.0.0                    py37_7  
jupyter_client            5.2.3                    py37_0  
jupyter_console           5.2.0                    py37_1  
jupyter_core              4.4.0                    py37_0  
jupyterlab                0.34.9                   py37_0  
jupyterlab_launcher       0.13.1                   py37_0  
keras-applications        1.0.8                      py_0  
keras-preprocessing       1.1.0                      py_1  
keyring                   13.2.1                   py37_0  
kiwisolver                1.0.1            py37h0a44026_0  
krb5                      1.16.1               hddcf347_7  
lazy-object-proxy         1.3.1            py37h1de35cc_2  
libcurl                   7.67.0               h051b688_0  
libcxx                    4.0.1                h579ed51_0  
libcxxabi                 4.0.1                hebd6815_0  
libedit                   3.1.20170329         hb402a30_2  
libffi                    3.2.1                h475c297_4  
libgfortran               3.0.1                h93005f0_2  
libiconv                  1.15                 hdd342a3_7  
libpng                    1.6.34               he12f830_0  
libprotobuf               3.11.4               hd9629dc_0  
libsodium                 1.0.16               h3efe00b_0  
libssh2                   1.9.0                ha12b0ac_1  
libtiff                   4.0.9                hcb84e12_2  
libxml2                   2.9.8                hab757c2_1  
libxslt                   1.1.32               hb819dd2_0  
llvmlite                  0.24.0           py37hc454e04_0  
locket                    0.2.0                    py37_1  
lxml                      4.2.5            py37hef8c89e_0  
lzo                       2.10                 h362108e_2  
markdown                  3.1.1                    py37_0  
markupsafe                1.0              py37h1de35cc_1  
matplotlib                2.2.3            py37h54f8f79_0  
mccabe                    0.6.1                    py37_1  
mistune                   0.8.3            py37h1de35cc_1  
mkl                       2019.4                      233  
mkl-service               2.3.0            py37hfbe908c_0  
mkl_fft                   1.0.15           py37h5e564d8_0  
mkl_random                1.1.0            py37ha771720_0  
more-itertools            4.3.0                    py37_0  
mpc                       1.1.0                h6ef4df4_1  
mpfr                      4.0.1                h3018a27_3  
mpmath                    1.0.0                    py37_2  
msgpack-python            0.5.6            py37h04f5b5a_1  
multipledispatch          0.6.0                    py37_0  
navigator-updater         0.2.1                    py37_0  
nbconvert                 5.4.0                    py37_1  
nbformat                  4.4.0                    py37_0  
ncurses                   6.1                  h0a44026_0  
networkx                  2.1                      py37_0  
nltk                      3.3.0                    py37_0  
nose                      1.3.7                    py37_2  
notebook                  5.6.0                    py37_0  
numba                     0.39.0           py37h6440ff4_0  
numexpr                   2.6.8            py37h1dc9127_0  
numpy                     1.18.1           py37h7241aed_0  
numpy-base                1.18.1           py37h3304bdc_1  
numpydoc                  0.8.0                    py37_0  
odo                       0.5.1                    py37_0  
olefile                   0.46                     py37_0  
openpyxl                  2.5.6                    py37_0  
openssl                   1.1.1g               h1de35cc_0  
opt_einsum                3.1.0                      py_0  
packaging                 17.1                     py37_0  
pandas                    0.23.4           py37h6440ff4_0  
pandoc                    1.19.2.1             ha5e8f32_1  
pandocfilters             1.4.2                    py37_1  
parso                     0.3.1                    py37_0  
partd                     0.3.8                    py37_0  
path.py                   11.1.0                   py37_0  
pathlib2                  2.3.2                    py37_0  
patsy                     0.5.0                    py37_0  
pcre                      8.42                 h378b8a2_0  
pep8                      1.7.1                    py37_0  
pexpect                   4.6.0                    py37_0  
pickleshare               0.7.4                    py37_0  
pillow                    5.2.0            py37hb68e598_0  
pip                       10.0.1                   py37_0  
pkginfo                   1.4.2                    py37_1  
pluggy                    0.7.1            py37h28b3542_0  
ply                       3.11                     py37_0  
prometheus_client         0.3.1            py37h28b3542_0  
prompt_toolkit            1.0.15                   py37_0  
protobuf                  3.11.4           py37h0a44026_0  
psutil                    5.4.7            py37h1de35cc_0  
ptyprocess                0.6.0                    py37_0  
py                        1.6.0                    py37_0  
pyasn1                    0.4.4            py37h28b3542_0  
pyasn1-modules            0.2.2                    py37_0  
pycodestyle               2.4.0                    py37_0  
pycosat                   0.6.3            py37h1de35cc_0  
pycparser                 2.18                     py37_1  
pycrypto                  2.6.1            py37h1de35cc_9  
pycurl                    7.43.0.5         py37ha12b0ac_0  
pyflakes                  2.0.0                    py37_0  
pygments                  2.2.0                    py37_0  
pyhamcrest                1.9.0                      py_2  
pylint                    2.1.1                    py37_0  
pyodbc                    4.0.24           py37h0a44026_0  
pyopenssl                 18.0.0                   py37_0  
pyparsing                 2.2.0                    py37_1  
pyqt                      5.9.2            py37h655552a_2  
pysocks                   1.6.8                    py37_0  
pytables                  3.4.4            py37h13cba08_0  
pytest                    3.8.0                    py37_0  
pytest-arraydiff          0.2              py37h39e3cac_0  
pytest-astropy            0.4.0                    py37_0  
pytest-doctestplus        0.1.3                    py37_0  
pytest-openfiles          0.3.0                    py37_0  
pytest-remotedata         0.3.0                    py37_0  
python                    3.7.2                haf84260_0  
python-dateutil           2.7.3                    py37_0  
python.app                2                        py37_8  
pytz                      2018.5                   py37_0  
pywavelets                1.0.0            py37h1d22016_0  
pyyaml                    3.13             py37h1de35cc_0  
pyzmq                     17.1.2           py37h1de35cc_0  
qt                        5.9.6                h45cd832_2  
qtawesome                 0.4.4                    py37_0  
qtconsole                 4.4.1                    py37_0  
qtpy                      1.5.0                    py37_0  
readline                  7.0                  h1de35cc_5  
requests                  2.19.1                   py37_0  
rope                      0.11.0                   py37_0  
ruamel_yaml               0.15.46          py37h1de35cc_0  
scikit-image              0.14.0           py37h0a44026_1  
scikit-learn              0.19.2           py37h4f467ca_0  
scipy                     1.4.1            py37h9fa6033_0  
seaborn                   0.9.0                    py37_0  
send2trash                1.5.0                    py37_0  
service_identity          17.0.0           py37h28b3542_0  
setuptools                47.1.1                   py37_0  
simplegeneric             0.8.1                    py37_2  
singledispatch            3.4.0.3                  py37_0  
sip                       4.19.8           py37h0a44026_0  
six                       1.15.0                     py_0  
snappy                    1.1.7                he62c110_3  
snowballstemmer           1.2.1                    py37_0  
sortedcollections         1.0.1                    py37_0  
sortedcontainers          2.0.5                    py37_0  
sphinx                    1.7.9                    py37_0  
sphinxcontrib             1.0                      py37_1  
sphinxcontrib-websupport  1.1.0                    py37_1  
spyder                    3.3.1                    py37_1  
spyder-kernels            0.2.6                    py37_0  
sqlalchemy                1.2.11           py37h1de35cc_0  
sqlite                    3.26.0               ha441bb4_0  
statsmodels               0.9.0            py37h1d22016_0  
sympy                     1.2                      py37_0  
tblib                     1.3.2                    py37_0  
tensorboard               2.0.0              pyhb38c66f_1  
tensorflow                2.0.0           mkl_py37hda344b4_0  
tensorflow-estimator      2.0.0              pyh2649769_0  
termcolor                 1.1.0                    py37_1  
terminado                 0.8.1                    py37_1  
testpath                  0.3.1                    py37_0  
tk                        8.6.8                ha441bb4_0  
toolz                     0.9.0                    py37_0  
tornado                   5.1              py37h1de35cc_0  
tqdm                      4.26.0           py37h28b3542_0  
traitlets                 4.3.2                    py37_0  
twisted                   19.2.0           py37h1de35cc_0  
unicodecsv                0.14.1                   py37_0  
unixodbc                  2.3.7                h1de35cc_0  
urllib3                   1.23                     py37_0  
wcwidth                   0.1.7                    py37_0  
webencodings              0.5.1                    py37_1  
werkzeug                  0.14.1                   py37_0  
wheel                     0.31.1                   py37_0  
widgetsnbextension        3.4.1                    py37_0  
wrapt                     1.12.1           py37h1de35cc_1  
xlrd                      1.1.0                    py37_1  
xlsxwriter                1.1.0                    py37_0  
xlwings                   0.11.8                   py37_0  
xlwt                      1.3.0                    py37_0  
xz                        5.2.4                h1de35cc_4  
yaml                      0.1.7                hc338f04_2  
zeromq                    4.2.5                h0a44026_1  
zict                      0.1.3                    py37_0  
zlib                      1.2.11               hf3cbc9b_2  
zope                      1.0                      py37_1  
zope.interface            4.5.0            py37h1de35cc_0  
(base) appledeMBP-5:~ apple$ conda info -e
# conda environments:
#
base                  *  /Users/apple/anaconda3
tensorflow-gpu           /Users/apple/anaconda3/envs/tensorflow-gpu

(base) appledeMBP-5:~ apple$ conda activate tensorflow-gpu
(tensorflow-gpu) appledeMBP-5:~ apple$ conda list
# packages in environment at /Users/apple/anaconda3/envs/tensorflow-gpu:
#
# Name                    Version                   Build  Channel
ca-certificates           2020.1.1                      0  
certifi                   2020.4.5.1               py36_0  
libcxx                    10.0.0                        1  
libedit                   3.1.20181209         hb402a30_0  
libffi                    3.3                  h0a44026_1  
ncurses                   6.2                  h0a44026_1  
numpy                     1.18.5                   pypi_0    pypi
openssl                   1.1.1g               h1de35cc_0  
pip                       20.0.2                   py36_3  
protobuf                  3.12.2                   pypi_0    pypi
python                    3.6.10               hf48f09d_2  
readline                  8.0                  h1de35cc_0  
setuptools                47.1.1                   py36_0  
six                       1.15.0                   pypi_0    pypi
sqlite                    3.31.1               h5c1f38d_1  
tensorflow-gpu            1.1.0                    pypi_0    pypi
tk                        8.6.8                ha441bb4_0  
werkzeug                  1.0.1                    pypi_0    pypi
wheel                     0.34.2                   py36_0  
xz                        5.2.5                h1de35cc_0  
zlib                      1.2.11               h1de35cc_3  
(tensorflow-gpu) appledeMBP-5:~ apple$ nvidia-smi
-bash: nvidia-smi: command not found
(tensorflow-gpu) appledeMBP-5:~ apple$ conda deactivate
(base) appledeMBP-5:~ apple$ conda remove -n tensorflow-gpu -all
usage: conda [-h] [-V] command ...
conda: error: unrecognized arguments: -all
(base) appledeMBP-5:~ apple$ conda remove -n tensorflow-gpu --all

Remove all packages in environment /Users/apple/anaconda3/envs/tensorflow-gpu:


## Package Plan ##

  environment location: /Users/apple/anaconda3/envs/tensorflow-gpu


The following packages will be REMOVED:

  ca-certificates-2020.1.1-0
  certifi-2020.4.5.1-py36_0
  libcxx-10.0.0-1
  libedit-3.1.20181209-hb402a30_0
  libffi-3.3-h0a44026_1
  ncurses-6.2-h0a44026_1
  openssl-1.1.1g-h1de35cc_0
  pip-20.0.2-py36_3
  python-3.6.10-hf48f09d_2
  readline-8.0-h1de35cc_0
  setuptools-47.1.1-py36_0
  sqlite-3.31.1-h5c1f38d_1
  tk-8.6.8-ha441bb4_0
  wheel-0.34.2-py36_0
  xz-5.2.5-h1de35cc_0
  zlib-1.2.11-h1de35cc_3


Proceed ([y]/n)? y

Preparing transaction: done
Verifying transaction: done
Executing transaction: done
(base) appledeMBP-5:~ apple$ conda create -n tensorflow python=3.6
Collecting package metadata (repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /Users/apple/anaconda3/envs/tensorflow

  added / updated specs:
    - python=3.6


The following NEW packages will be INSTALLED:

  ca-certificates    pkgs/main/osx-64::ca-certificates-2020.1.1-0
  certifi            pkgs/main/osx-64::certifi-2020.4.5.1-py36_0
  libcxx             pkgs/main/osx-64::libcxx-10.0.0-1
  libedit            pkgs/main/osx-64::libedit-3.1.20181209-hb402a30_0
  libffi             pkgs/main/osx-64::libffi-3.3-h0a44026_1
  ncurses            pkgs/main/osx-64::ncurses-6.2-h0a44026_1
  openssl            pkgs/main/osx-64::openssl-1.1.1g-h1de35cc_0
  pip                pkgs/main/osx-64::pip-20.0.2-py36_3
  python             pkgs/main/osx-64::python-3.6.10-hf48f09d_2
  readline           pkgs/main/osx-64::readline-8.0-h1de35cc_0
  setuptools         pkgs/main/osx-64::setuptools-47.1.1-py36_0
  sqlite             pkgs/main/osx-64::sqlite-3.31.1-h5c1f38d_1
  tk                 pkgs/main/osx-64::tk-8.6.8-ha441bb4_0
  wheel              pkgs/main/osx-64::wheel-0.34.2-py36_0
  xz                 pkgs/main/osx-64::xz-5.2.5-h1de35cc_0
  zlib               pkgs/main/osx-64::zlib-1.2.11-h1de35cc_3


Proceed ([y]/n)? y

Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
#     $ conda activate tensorflow
#
# To deactivate an active environment, use
#
#     $ conda deactivate

(base) appledeMBP-5:~ apple$ conda info -e
# conda environments:
#
base                  *  /Users/apple/anaconda3
tensorflow               /Users/apple/anaconda3/envs/tensorflow

(base) appledeMBP-5:~ apple$ conda activate tensorflow
(tensorflow) appledeMBP-5:~ apple$ conda install tensorflow=2.1
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.

PackagesNotFoundError: The following packages are not available from current channels:

  - tensorflow=2.1

Current channels:

  - https://repo.anaconda.com/pkgs/main/osx-64
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/r/osx-64
  - https://repo.anaconda.com/pkgs/r/noarch

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.


(tensorflow) appledeMBP-5:~ apple$ 
(tensorflow) appledeMBP-5:~ apple$ conda config --show
add_anaconda_token: True
add_pip_as_python_dependency: True
aggressive_update_packages:
  - ca-certificates
  - certifi
  - openssl
allow_conda_downgrades: False
allow_cycles: True
allow_non_channel_urls: False
allow_softlinks: False
always_copy: False
always_softlink: False
always_yes: None
anaconda_upload: None
auto_activate_base: True
auto_stack: 0
auto_update_conda: True
bld_path: 
changeps1: True
channel_alias: https://conda.anaconda.org
channel_priority: flexible
channels:
  - defaults
client_ssl_cert: None
client_ssl_cert_key: None
clobber: False
conda_build: {}
create_default_packages: []
croot: /Users/apple/anaconda3/conda-bld
custom_channels:
  pkgs/main: https://repo.anaconda.com
  pkgs/r: https://repo.anaconda.com
  pkgs/pro: https://repo.anaconda.com
custom_multichannels:
  defaults: 
    - https://repo.anaconda.com/pkgs/main
    - https://repo.anaconda.com/pkgs/r
  local: 
debug: False
default_channels:
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
default_python: 3.7
default_threads: None
deps_modifier: not_set
dev: False
disallowed_packages: []
download_only: False
dry_run: False
enable_private_envs: False
env_prompt: ({default_env}) 
envs_dirs:
  - /Users/apple/anaconda3/envs
  - /Users/apple/.conda/envs
error_upload_url: https://conda.io/conda-post/unexpected-error
execute_threads: 1
extra_safety_checks: False
force: False
force_32bit: False
force_reinstall: False
force_remove: False
ignore_pinned: False
json: False
local_repodata_ttl: 1
migrated_channel_aliases: []
migrated_custom_channels: {}
non_admin_enabled: True
notify_outdated_conda: True
offline: False
override_channels_enabled: True
path_conflict: clobber
pinned_packages: []
pip_interop_enabled: False
pkgs_dirs:
  - /Users/apple/anaconda3/pkgs
  - /Users/apple/.conda/pkgs
proxy_servers: {}
quiet: False
remote_backoff_factor: 1
remote_connect_timeout_secs: 9.15
remote_max_retries: 3
remote_read_timeout_secs: 60.0
repodata_fns:
  - current_repodata.json
  - repodata.json
repodata_threads: None
report_errors: None
restore_free_channel: False
rollback_enabled: True
root_prefix: /Users/apple/anaconda3
safety_checks: warn
sat_solver: pycosat
separate_format_cache: False
shortcuts: True
show_channel_urls: None
solver_ignore_timestamps: False
ssl_verify: True
subdir: osx-64
subdirs:
  - osx-64
  - noarch
target_prefix_override: 
track_features: []
unsatisfiable_hints: True
unsatisfiable_hints_check_depth: 2
update_modifier: update_specs
use_index_cache: False
use_local: False
use_only_tar_bz2: True
verbosity: 0
verify_threads: 1
whitelist_channels: []
(tensorflow) appledeMBP-5:~ apple$ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
(tensorflow) appledeMBP-5:~ apple$ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
(tensorflow) appledeMBP-5:~ apple$ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch
(tensorflow) appledeMBP-5:~ apple$ conda config --set show_channel_urls yes
(tensorflow) appledeMBP-5:~ apple$ conda install tensorflow=2.1
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.

PackagesNotFoundError: The following packages are not available from current channels:

  - tensorflow=2.1

Current channels:

  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/osx-64
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/noarch
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/osx-64
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/noarch
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/osx-64
  - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/noarch
  - https://repo.anaconda.com/pkgs/main/osx-64
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/r/osx-64
  - https://repo.anaconda.com/pkgs/r/noarch

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.


(tensorflow) appledeMBP-5:~ apple$ conda install tensorflow=2.0
Collecting package metadata (repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /Users/apple/anaconda3/envs/tensorflow

  added / updated specs:
    - tensorflow=2.0


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    _tflow_select-2.3.0        |              mkl           3 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    absl-py-0.9.0              |           py36_0         165 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    astor-0.8.0                |           py36_0          45 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    blas-1.0                   |              mkl           5 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    c-ares-1.15.0              |    h1de35cc_1001          83 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    ca-certificates-2020.1.1   |                0         132 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    certifi-2020.4.5.1         |           py36_0         159 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    gast-0.2.2                 |           py36_0         138 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    google-pasta-0.2.0         |             py_0          44 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    grpcio-1.16.1              |   py36h044775b_1         944 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    h5py-2.10.0                |   py36h3134771_0        1003 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    hdf5-1.10.4                |       hfa1e0ec_0         4.5 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    intel-openmp-2019.4        |              233         1.1 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    keras-applications-1.0.8   |             py_0          33 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    keras-preprocessing-1.1.0  |             py_1          36 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    libgfortran-3.0.1          |       h93005f0_2         495 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    libprotobuf-3.11.4         |       hd9629dc_0         4.5 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    markdown-3.1.1             |           py36_0         113 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    mkl-2019.4                 |              233       155.2 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    mkl-service-2.3.0          |   py36hfbe908c_0         188 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    mkl_fft-1.0.15             |   py36h5e564d8_0         160 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    mkl_random-1.1.1           |   py36h959d312_0         334 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    numpy-1.18.1               |   py36h7241aed_0           5 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    numpy-base-1.18.1          |   py36h3304bdc_1         5.0 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    openssl-1.1.1g             |       h1de35cc_0         3.4 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    opt_einsum-3.1.0           |             py_0          54 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    protobuf-3.11.4            |   py36h0a44026_0         695 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    scipy-1.4.1                |   py36h9fa6033_0        16.8 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    six-1.15.0                 |             py_0          13 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    tensorboard-2.0.0          |     pyhb38c66f_1         3.3 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    tensorflow-2.0.0           |mkl_py36ha38f243_0           4 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    tensorflow-base-2.0.0      |mkl_py36h66b1bf0_0       107.9 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    tensorflow-estimator-2.0.0 |     pyh2649769_0         272 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    termcolor-1.1.0            |           py36_1           7 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    werkzeug-1.0.1             |             py_0         243 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    wrapt-1.12.1               |   py36h1de35cc_1          45 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    ------------------------------------------------------------
                                           Total:       307.1 MB

The following NEW packages will be INSTALLED:

  _tflow_select      anaconda/pkgs/main/osx-64::_tflow_select-2.3.0-mkl
  absl-py            anaconda/pkgs/main/osx-64::absl-py-0.9.0-py36_0
  astor              anaconda/pkgs/main/osx-64::astor-0.8.0-py36_0
  blas               anaconda/pkgs/main/osx-64::blas-1.0-mkl
  c-ares             anaconda/pkgs/main/osx-64::c-ares-1.15.0-h1de35cc_1001
  gast               anaconda/pkgs/main/osx-64::gast-0.2.2-py36_0
  google-pasta       anaconda/pkgs/main/noarch::google-pasta-0.2.0-py_0
  grpcio             anaconda/pkgs/main/osx-64::grpcio-1.16.1-py36h044775b_1
  h5py               anaconda/pkgs/main/osx-64::h5py-2.10.0-py36h3134771_0
  hdf5               anaconda/pkgs/main/osx-64::hdf5-1.10.4-hfa1e0ec_0
  intel-openmp       anaconda/pkgs/main/osx-64::intel-openmp-2019.4-233
  keras-applications anaconda/pkgs/main/noarch::keras-applications-1.0.8-py_0
  keras-preprocessi~ anaconda/pkgs/main/noarch::keras-preprocessing-1.1.0-py_1
  libgfortran        anaconda/pkgs/main/osx-64::libgfortran-3.0.1-h93005f0_2
  libprotobuf        anaconda/pkgs/main/osx-64::libprotobuf-3.11.4-hd9629dc_0
  markdown           anaconda/pkgs/main/osx-64::markdown-3.1.1-py36_0
  mkl                anaconda/pkgs/main/osx-64::mkl-2019.4-233
  mkl-service        anaconda/pkgs/main/osx-64::mkl-service-2.3.0-py36hfbe908c_0
  mkl_fft            anaconda/pkgs/main/osx-64::mkl_fft-1.0.15-py36h5e564d8_0
  mkl_random         anaconda/pkgs/main/osx-64::mkl_random-1.1.1-py36h959d312_0
  numpy              anaconda/pkgs/main/osx-64::numpy-1.18.1-py36h7241aed_0
  numpy-base         anaconda/pkgs/main/osx-64::numpy-base-1.18.1-py36h3304bdc_1
  opt_einsum         anaconda/pkgs/main/noarch::opt_einsum-3.1.0-py_0
  protobuf           anaconda/pkgs/main/osx-64::protobuf-3.11.4-py36h0a44026_0
  scipy              anaconda/pkgs/main/osx-64::scipy-1.4.1-py36h9fa6033_0
  six                anaconda/pkgs/main/noarch::six-1.15.0-py_0
  tensorboard        anaconda/pkgs/main/noarch::tensorboard-2.0.0-pyhb38c66f_1
  tensorflow         anaconda/pkgs/main/osx-64::tensorflow-2.0.0-mkl_py36ha38f243_0
  tensorflow-base    anaconda/pkgs/main/osx-64::tensorflow-base-2.0.0-mkl_py36h66b1bf0_0
  tensorflow-estima~ anaconda/pkgs/main/noarch::tensorflow-estimator-2.0.0-pyh2649769_0
  termcolor          anaconda/pkgs/main/osx-64::termcolor-1.1.0-py36_1
  werkzeug           anaconda/pkgs/main/noarch::werkzeug-1.0.1-py_0
  wrapt              anaconda/pkgs/main/osx-64::wrapt-1.12.1-py36h1de35cc_1

The following packages will be SUPERSEDED by a higher-priority channel:

  ca-certificates                                 pkgs/main --> anaconda/pkgs/main
  certifi                                         pkgs/main --> anaconda/pkgs/main
  openssl                                         pkgs/main --> anaconda/pkgs/main


Proceed ([y]/n)? y


Downloading and Extracting Packages
ca-certificates-2020 | 132 KB    | ################################################################################################## | 100% 
_tflow_select-2.3.0  | 3 KB      | ################################################################################################## | 100% 
c-ares-1.15.0        | 83 KB     | ################################################################################################## | 100% 
mkl_fft-1.0.15       | 160 KB    | ################################################################################################## | 100% 
blas-1.0             | 5 KB      | ################################################################################################## | 100% 
libgfortran-3.0.1    | 495 KB    | ################################################################################################## | 100% 
google-pasta-0.2.0   | 44 KB     | ################################################################################################## | 100% 
absl-py-0.9.0        | 165 KB    | ################################################################################################## | 100% 
mkl_random-1.1.1     | 334 KB    | ################################################################################################## | 100% 
six-1.15.0           | 13 KB     | ################################################################################################## | 100% 
mkl-2019.4           | 155.2 MB  | ################################################################################################## | 100% 
gast-0.2.2           | 138 KB    | ################################################################################################## | 100% 
tensorflow-estimator | 272 KB    | ################################################################################################## | 100% 
keras-applications-1 | 33 KB     | ################################################################################################## | 100% 
tensorflow-2.0.0     | 4 KB      | ################################################################################################## | 100% 
certifi-2020.4.5.1   | 159 KB    | ################################################################################################## | 100% 
wrapt-1.12.1         | 45 KB     | ################################################################################################## | 100% 
numpy-base-1.18.1    | 5.0 MB    | ################################################################################################## | 100% 
keras-preprocessing- | 36 KB     | ################################################################################################## | 100% 
tensorflow-base-2.0. | 107.9 MB  | ################################################################################################## | 100% 
opt_einsum-3.1.0     | 54 KB     | ################################################################################################## | 100% 
grpcio-1.16.1        | 944 KB    | ################################################################################################## | 100% 
h5py-2.10.0          | 1003 KB   | ################################################################################################## | 100% 
protobuf-3.11.4      | 695 KB    | ################################################################################################## | 100% 
werkzeug-1.0.1       | 243 KB    | ################################################################################################## | 100% 
scipy-1.4.1          | 16.8 MB   | ################################################################################################## | 100% 
libprotobuf-3.11.4   | 4.5 MB    | ################################################################################################## | 100% 
mkl-service-2.3.0    | 188 KB    | ################################################################################################## | 100% 
markdown-3.1.1       | 113 KB    | ################################################################################################## | 100% 
numpy-1.18.1         | 5 KB      | ################################################################################################## | 100% 
openssl-1.1.1g       | 3.4 MB    | ################################################################################################## | 100% 
hdf5-1.10.4          | 4.5 MB    | ################################################################################################## | 100% 
intel-openmp-2019.4  | 1.1 MB    | ################################################################################################## | 100% 
tensorboard-2.0.0    | 3.3 MB    | ################################################################################################## | 100% 
termcolor-1.1.0      | 7 KB      | ################################################################################################## | 100% 
astor-0.8.0          | 45 KB     | ################################################################################################## | 100% 
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
(tensorflow) appledeMBP-5:~ apple$ python
Python 3.6.10 |Anaconda, Inc.| (default, May  7 2020, 23:06:31) 
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> tf.__version__
'2.0.0'
>>> tf.keras.__version__
'2.2.4-tf'
>>> exit()
(tensorflow) appledeMBP-5:~ apple$ pip3 install tplotlib
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
^[[AERROR: Could not find a version that satisfies the requirement tplotlib (from versions: none)
ERROR: No matching distribution found for tplotlib
(tensorflow) appledeMBP-5:~ apple$ pip3 install matplotlib
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting matplotlib
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/0d/61/b741990b429341bac1af5f5c645ee7aaa3bbe7daf3418d283c92c4b5ee82/matplotlib-3.2.1-cp37-cp37m-macosx_10_9_x86_64.whl (12.4 MB)
Collecting cycler>=0.10
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/f7/d2/e07d3ebb2bd7af696440ce7e754c59dd546ffe1bbe732c8ab68b9c834e61/cycler-0.10.0-py2.py3-none-any.whl (6.5 kB)
Collecting python-dateutil>=2.1
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/d4/70/d60450c3dd48ef87586924207ae8907090de0b306af2bce5d134d78615cb/python_dateutil-2.8.1-py2.py3-none-any.whl (227 kB)
Collecting kiwisolver>=1.0.1
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/81/c5/9831f281c6fb57945e83fdf39ff036cacfdc84aa1988bb3150b330533050/kiwisolver-1.2.0-cp37-cp37m-macosx_10_9_x86_64.whl (60 kB)
Collecting numpy>=1.11
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/3e/00/0266fefaafb839760d5b25b884375b2ab0f842ebe138ee6c1ef807af44bb/numpy-1.18.5-cp37-cp37m-macosx_10_9_x86_64.whl (15.1 MB)
Collecting pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/8a/bb/488841f56197b13700afd5658fc279a2025a39e22449b7cf29864669b15d/pyparsing-2.4.7-py2.py3-none-any.whl (67 kB)
Collecting six
  Using cached https://pypi.tuna.tsinghua.edu.cn/packages/ee/ff/48bde5c0f013094d729fe4b0316ba2a24774b3ff1c52d924a8a4cb04078a/six-1.15.0-py2.py3-none-any.whl (10 kB)
ERROR: traitlets 4.3.3 requires decorator, which is not installed.
ERROR: keras-applications 1.0.8 requires h5py, which is not installed.
ERROR: ipython 7.13.0 requires decorator, which is not installed.
Installing collected packages: six, cycler, python-dateutil, kiwisolver, numpy, pyparsing, matplotlib
Successfully installed cycler-0.10.0 kiwisolver-1.2.0 matplotlib-3.2.1 numpy-1.18.5 pyparsing-2.4.7 python-dateutil-2.8.1 six-1.15.0
(tensorflow) appledeMBP-5:~ apple$ conda install matplotlib
Collecting package metadata (repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /Users/apple/anaconda3/envs/tensorflow

  added / updated specs:
    - matplotlib


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    cycler-0.10.0              |   py36hfc81398_0          13 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    freetype-2.9.1             |       hb4e5f40_0         864 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    kiwisolver-1.2.0           |   py36h04f5b5a_0          62 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    libpng-1.6.37              |       ha441bb4_0         325 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    matplotlib-3.1.3           |           py36_0          20 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    matplotlib-base-3.1.3      |   py36h9aa3819_0         6.6 MB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    pyparsing-2.4.7            |             py_0          64 KB  https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
    ------------------------------------------------------------
                                           Total:         7.9 MB

The following NEW packages will be INSTALLED:

  cycler             anaconda/pkgs/main/osx-64::cycler-0.10.0-py36hfc81398_0
  freetype           anaconda/pkgs/main/osx-64::freetype-2.9.1-hb4e5f40_0
  kiwisolver         anaconda/pkgs/main/osx-64::kiwisolver-1.2.0-py36h04f5b5a_0
  libpng             anaconda/pkgs/main/osx-64::libpng-1.6.37-ha441bb4_0
  matplotlib         anaconda/pkgs/main/osx-64::matplotlib-3.1.3-py36_0
  matplotlib-base    anaconda/pkgs/main/osx-64::matplotlib-base-3.1.3-py36h9aa3819_0
  pyparsing          anaconda/pkgs/main/noarch::pyparsing-2.4.7-py_0


Proceed ([y]/n)? y


Downloading and Extracting Packages
matplotlib-base-3.1. | 6.6 MB    | ##################################### | 100% 
cycler-0.10.0        | 13 KB     | ##################################### | 100% 
matplotlib-3.1.3     | 20 KB     | ##################################### | 100% 
kiwisolver-1.2.0     | 62 KB     | ##################################### | 100% 
pyparsing-2.4.7      | 64 KB     | ##################################### | 100% 
freetype-2.9.1       | 864 KB    | ##################################### | 100% 
libpng-1.6.37        | 325 KB    | ##################################### | 100% 
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
(tensorflow) appledeMBP-5:~ apple$ jupyter notebook
Traceback (most recent call last):
  File "/Users/apple/anaconda3/envs/tensorflow/bin/jupyter", line 11, in <module>
    sys.exit(main())
  File "/Users/apple/anaconda3/envs/tensorflow/lib/python3.6/site-packages/jupyter_core/command.py", line 247, in main
    command = _jupyter_abspath(subcommand)
  File "/Users/apple/anaconda3/envs/tensorflow/lib/python3.6/site-packages/jupyter_core/command.py", line 134, in _jupyter_abspath
    'Jupyter command `{}` not found.'.format(jupyter_subcommand)
Exception: Jupyter command `jupyter-notebook` not found.
(tensorflow) appledeMBP-5:~ apple$ 

 

### 回答1: 好的,我可以为您提供一些关于 TensorFlow 安装的基本信息。以下是 TensorFlow安装步骤: 1. 安装 Anaconda:在 https://www.anaconda.com/products/individual 下载 Anaconda 安装包,并按照提示进行安装。Anaconda 是一个 Python 发行版,它包含了常用的 Python 程序和第三方库。 2. 创建虚拟环境:在 Anaconda Prompt 中输入以下命令创建一个名为 tensorflow 的虚拟环境: ``` conda create -n tensorflow python=3.8 ``` 3. 激活虚拟环境:在 Anaconda Prompt 中输入以下命令,激活名为 tensorflow 的虚拟环境: ``` conda activate tensorflow ``` 4. 安装 TensorFlow:在 Anaconda Prompt 中输入以下命令,安装 TensorFlow: ``` pip install tensorflow ``` 5. 验证 TensorFlow 安装:在 Python 中输入以下代码,验证 TensorFlow 是否安装成功: ``` import tensorflow as tf tf.__version__ ``` 以上是 TensorFlow 的基本安装步骤。希望对您有所帮助。 ### 回答2: TensorFlow是一个开源的人工智能框架,用于构建和训练各种机器学习模型。以下是关于TensorFlow安装的300字回答: TensorFlow可以在多个操作系统上安装,包括Windows、Linux和macOS。对于Windows用户,可以通过pip工具进行安装。首先,需要在Python环境中安装pip。然后,在命令行中输入以下命令来安装TensorFlow: ``` pip install tensorflow ``` 这将自动下载和安装最新版本的TensorFlow。如果希望安装特定版本的TensorFlow,可以使用以下命令: ``` pip install tensorflow==<version> ``` 其中,`<version>`是所需的TensorFlow版本号。 对于Linux和macOS用户,首先需要确保已安装Python和pip。然后,可以使用以下命令来安装TensorFlow: ``` pip install tensorflow ``` 如果系统中有多个Python版本,则可以使用以下命令来指定使用的Python版本进行安装: ``` pip3 install tensorflow ``` 安装完成后,可以验证TensorFlow是否成功安装。在Python环境中,输入以下代码来导入TensorFlow包: ```python import tensorflow as tf ``` 如果没有报错信息,则说明TensorFlow已成功安装。 除了通过pip进行安装外,还可以通过源代码来手动编译和安装TensorFlow。这需要下载TensorFlow的源代码,并按照官方文档的指导进行编译、配置和安装。 总而言之,TensorFlow安装可以通过pip或手动编译完成。根据操作系统的不同,可以选择适合的安装方式来安装TensorFlow。 ### 回答3: 要安装TensorFlow,你需要遵循以下步骤: 1. 首先,确保你的计算机上已经安装Python。TensorFlow兼容Python 3.5、3.6和3.7版本。 2. 接下来,你可以通过使用pip或conda包管理器来安装TensorFlow。如果你使用的是pip,可以在命令行中输入以下命令:`pip install tensorflow`。 3. 如果你使用的是conda包管理器,可以通过在命令行中输入以下命令来安装TensorFlow:`conda install tensorflow`。 4. 安装完成后,可以验证安装是否成功。你可以在Python命令行中输入以下代码来导入TensorFlow并查看版本号: ``` import tensorflow as tf print(tf.__version__) ``` 如果成功打印出TensorFlow的版本号,说明安装成功。 5. 如果你想使用GPU加速,在安装前需要先安装CUDA和cuDNN。具体安装步骤可以参考NVIDIA官方文档。 6. 使用TensorFlow之前,可以尝试执行一些示例代码,如构建一个简单的神经网络模型并进行训练。这将帮助你熟悉TensorFlow的基本用法和功能。 总之,安装TensorFlow只需几个简单的步骤,让你能够享受到强大的机器学习和深度学习的功能。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值