MacOS 使用miniconda 虚拟环境 TensorFlow深度学习环境

TensorFlow 官网地址

https://tensorflow.google.cn/

TensorFlow 2 软件包需要使用高于 19.0 的 pip 版本(对于 macOS 来说,则需要高于 20.3 的 pip 版本)。

安装 TensorFlow 2 说明

我们在以下 64 位系统上测试过 TensorFlow 并且这些系统支持 TensorFlow:

Python 3.6–3.9
Ubuntu 16.04 或更高版本
Windows 7 或更高版本(含 C++ 可再发行软件包)
macOS 10.12.6 (Sierra) 或更高版本(不支持 GPU)

MacOS使用brew 安装miniconda

$ brew install miniconda

$  brew install miniconda
Running brew update --preinstall...

==> Auto-updated Homebrew!

Updated 3 taps (homebrew/core, homebrew/cask and homebrew/services).

==> Updated Formulae
Updated 12 formulae.

==> New Casks
irpf2022            lapce               mellel              simplemind
==> Updated Casks
Updated 311 casks.

==> Caveats
Please run the following to setup your shell:
  conda init "$(basename "${SHELL}")"

==> Downloading https://repo.anaconda.com/miniconda/Miniconda3-py39_4.11.0-MacOS
Already downloaded: /Users/yanghaoyuan/Library/Caches/Homebrew/downloads/95edbdab0937497b9aae95c8f7717ef78bd55c4c5d0971c81213a005a2ee3ede--Miniconda3-py39_4.11.0-MacOSX-x86_64.sh
==> Installing Cask miniconda
==> Running installer script 'Miniconda3-py39_4.11.0-MacOSX-x86_64.sh'
PREFIX=/usr/local/Caskroom/miniconda/base
Unpacking payload ...

Extracting : cffi-1.15.0-py39hc55c11b_1.conda:   0%|          | 0/35 [00:00<?, ?Extracting : cffi-1.15.0-py39hc55c11b_1.conda:   3%|▎         | 1/35 [00:00<00:2Extracting : certifi-2021.10.8-py39hecd8cb5_2.conda:   3%|▎         | 1/35 [00:0Extracting : libffi-3.3-hb1e8313_2.conda:   6%|▌         | 2/35 [00:00<00:23,  1Extracting : python-3.9.7-h88f2d9e_1.conda:   9%|▊         | 3/35 [00:04<00:22, Extracting : python-3.9.7-h88f2d9e_1.conda:  11%|█▏        | 4/35 [00:04<00:32, Extracting : ruamel_yaml-0.15.100-py39h9ed2024_0.conda:  11%|█▏        | 4/35 [0Extracting : urllib3-1.26.7-pyhd3eb1b0_0.conda:  14%|█▍        | 5/35 [00:04<00:Extracting : requests-2.27.1-pyhd3eb1b0_0.conda:  17%|█▋        | 6/35 [00:04<00Extracting : setuptools-58.0.4-py39hecd8cb5_0.conda:  20%|██        | 7/35 [00:0Extracting : six-1.16.0-pyhd3eb1b0_0.conda:  23%|██▎       | 8/35 [00:04<00:28, Extracting : pysocks-1.7.1-py39hecd8cb5_0.conda:  26%|██▌       | 9/35 [00:04<00Extracting : ca-certificates-2021.10.26-hecd8cb5_2.conda:  29%|██▊       | 10/35Extracting : ncurses-6.3-hca72f7f_2.conda:  31%|███▏      | 11/35 [00:04<00:24, Extracting : wheel-0.37.1-pyhd3eb1b0_0.conda:  34%|███▍      | 12/35 [00:04<00:2Extracting : brotlipy-0.7.0-py39h9ed2024_1003.conda:  37%|███▋      | 13/35 [00:Extracting : charset-normalizer-2.0.4-pyhd3eb1b0_0.conda:  40%|████      | 14/35Extracting : tk-8.6.11-h7bc2e8c_0.conda:  43%|████▎     | 15/35 [00:04<00:20,  1Extracting : pycosat-0.6.3-py39h9ed2024_0.conda:  46%|████▌     | 16/35 [00:04<0Extracting : conda-4.11.0-py39hecd8cb5_0.conda:  49%|████▊     | 17/35 [00:05<00Extracting : conda-4.11.0-py39hecd8cb5_0.conda:  51%|█████▏    | 18/35 [00:05<00Extracting : readline-8.1.2-hca72f7f_1.conda:  51%|█████▏    | 18/35 [00:05<00:0Extracting : pycparser-2.21-pyhd3eb1b0_0.conda:  54%|█████▍    | 19/35 [00:05<00Extracting : conda-package-handling-1.7.3-py39h9ed2024_1.conda:  57%|█████▋    |Extracting : pip-21.2.4-py39hecd8cb5_0.conda:  60%|██████    | 21/35 [00:05<00:0Extracting : tzdata-2021e-hda174b7_0.conda:  63%|██████▎   | 22/35 [00:05<00:02,Extracting : tqdm-4.62.3-pyhd3eb1b0_1.conda:  66%|██████▌   | 23/35 [00:05<00:02Extracting : cryptography-36.0.0-py39hf6deb26_0.conda:  69%|██████▊   | 24/35 [0Extracting : pyopenssl-21.0.0-pyhd3eb1b0_1.conda:  71%|███████▏  | 25/35 [00:05<Extracting : openssl-1.1.1m-hca72f7f_0.conda:  74%|███████▍  | 26/35 [00:05<00:0Extracting : python.app-3-py39hca72f7f_0.conda:  77%|███████▋  | 27/35 [00:05<00Extracting : sqlite-3.37.0-h707629a_0.conda:  80%|████████  | 28/35 [00:05<00:01Extracting : conda-content-trust-0.1.1-pyhd3eb1b0_0.conda:  83%|████████▎ | 29/3Extracting : idna-3.3-pyhd3eb1b0_0.conda:  86%|████████▌ | 30/35 [00:05<00:01,  Extracting : zlib-1.2.11-h4dc903c_4.conda:  89%|████████▊ | 31/35 [00:05<00:00, Extracting : xz-5.2.5-h1de35cc_0.conda:  91%|█████████▏| 32/35 [00:05<00:00,  4.Extracting : libcxx-12.0.0-h2f01273_0.conda:  94%|█████████▍| 33/35 [00:05<00:00Extracting : yaml-0.2.5-haf1e3a3_0.conda:  97%|█████████▋| 34/35 [00:05<00:00,                                                                                  Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... done

  environment location: /usr/local/Caskroom/miniconda/base

  added / updated specs:
    - brotlipy==0.7.0=py39h9ed2024_1003
    - ca-certificates==2021.10.26=hecd8cb5_2
    - certifi==2021.10.8=py39hecd8cb5_2
    - cffi==1.15.0=py39hc55c11b_1
    - charset-normalizer==2.0.4=pyhd3eb1b0_0
    - conda-content-trust==0.1.1=pyhd3eb1b0_0
    - conda-package-handling==1.7.3=py39h9ed2024_1
    - conda==4.11.0=py39hecd8cb5_0
    - cryptography==36.0.0=py39hf6deb26_0
    - idna==3.3=pyhd3eb1b0_0
    - libcxx==12.0.0=h2f01273_0
    - libffi==3.3=hb1e8313_2
    - ncurses==6.3=hca72f7f_2
    - openssl==1.1.1m=hca72f7f_0
    - pip==21.2.4=py39hecd8cb5_0
    - pycosat==0.6.3=py39h9ed2024_0
    - pycparser==2.21=pyhd3eb1b0_0
    - pyopenssl==21.0.0=pyhd3eb1b0_1
    - pysocks==1.7.1=py39hecd8cb5_0
    - python.app==3=py39hca72f7f_0
    - python==3.9.7=h88f2d9e_1
    - readline==8.1.2=hca72f7f_1
    - requests==2.27.1=pyhd3eb1b0_0
    - ruamel_yaml==0.15.100=py39h9ed2024_0
    - setuptools==58.0.4=py39hecd8cb5_0
    - six==1.16.0=pyhd3eb1b0_0
    - sqlite==3.37.0=h707629a_0
    - tk==8.6.11=h7bc2e8c_0
    - tqdm==4.62.3=pyhd3eb1b0_1
    - tzdata==2021e=hda174b7_0
    - urllib3==1.26.7=pyhd3eb1b0_0
    - wheel==0.37.1=pyhd3eb1b0_0
    - xz==5.2.5=h1de35cc_0
    - yaml==0.2.5=haf1e3a3_0
    - zlib==1.2.11=h4dc903c_4

The following NEW packages will be INSTALLED:

  brotlipy           pkgs/main/osx-64::brotlipy-0.7.0-py39h9ed2024_1003
  ca-certificates    pkgs/main/osx-64::ca-certificates-2021.10.26-hecd8cb5_2
  certifi            pkgs/main/osx-64::certifi-2021.10.8-py39hecd8cb5_2
  cffi               pkgs/main/osx-64::cffi-1.15.0-py39hc55c11b_1
  charset-normalizer pkgs/main/noarch::charset-normalizer-2.0.4-pyhd3eb1b0_0
  conda              pkgs/main/osx-64::conda-4.11.0-py39hecd8cb5_0
  conda-content-tru~ pkgs/main/noarch::conda-content-trust-0.1.1-pyhd3eb1b0_0
  conda-package-han~ pkgs/main/osx-64::conda-package-handling-1.7.3-py39h9ed2024_1
  cryptography       pkgs/main/osx-64::cryptography-36.0.0-py39hf6deb26_0
  idna               pkgs/main/noarch::idna-3.3-pyhd3eb1b0_0
  libcxx             pkgs/main/osx-64::libcxx-12.0.0-h2f01273_0
  libffi             pkgs/main/osx-64::libffi-3.3-hb1e8313_2
  ncurses            pkgs/main/osx-64::ncurses-6.3-hca72f7f_2
  openssl            pkgs/main/osx-64::openssl-1.1.1m-hca72f7f_0
  pip                pkgs/main/osx-64::pip-21.2.4-py39hecd8cb5_0
  pycosat            pkgs/main/osx-64::pycosat-0.6.3-py39h9ed2024_0
  pycparser          pkgs/main/noarch::pycparser-2.21-pyhd3eb1b0_0
  pyopenssl          pkgs/main/noarch::pyopenssl-21.0.0-pyhd3eb1b0_1
  pysocks            pkgs/main/osx-64::pysocks-1.7.1-py39hecd8cb5_0
  python             pkgs/main/osx-64::python-3.9.7-h88f2d9e_1
  python.app         pkgs/main/osx-64::python.app-3-py39hca72f7f_0
  readline           pkgs/main/osx-64::readline-8.1.2-hca72f7f_1
  requests           pkgs/main/noarch::requests-2.27.1-pyhd3eb1b0_0
  ruamel_yaml        pkgs/main/osx-64::ruamel_yaml-0.15.100-py39h9ed2024_0
  setuptools         pkgs/main/osx-64::setuptools-58.0.4-py39hecd8cb5_0
  six                pkgs/main/noarch::six-1.16.0-pyhd3eb1b0_0
  sqlite             pkgs/main/osx-64::sqlite-3.37.0-h707629a_0
  tk                 pkgs/main/osx-64::tk-8.6.11-h7bc2e8c_0
  tqdm               pkgs/main/noarch::tqdm-4.62.3-pyhd3eb1b0_1
  tzdata             pkgs/main/noarch::tzdata-2021e-hda174b7_0
  urllib3            pkgs/main/noarch::urllib3-1.26.7-pyhd3eb1b0_0
  wheel              pkgs/main/noarch::wheel-0.37.1-pyhd3eb1b0_0
  xz                 pkgs/main/osx-64::xz-5.2.5-h1de35cc_0
  yaml               pkgs/main/osx-64::yaml-0.2.5-haf1e3a3_0
  zlib               pkgs/main/osx-64::zlib-1.2.11-h4dc903c_4

Preparing transaction: ...working... done
Executing transaction: ...working...

done
installation finished.

==> Linking Binary 'conda' to '/usr/local/bin/conda'
🍺  miniconda was successfully installed!

miniconda 安装成功 查看安装版本命令 conda -V

$ conda -V
conda 4.11.0

查询 python 版本和 conda env

$ python -V
Python 2.7.16
$ conda env list

base                  *  /usr/local/Caskroom/miniconda/base

创建虚拟环境

$ conda create -n TensorFlow2 -y

$ conda create -n TensorFlow2
Collecting package metadata (current_repodata.json): done
Solving environment: done

==> WARNING: A newer version of conda exists. =
  current version: 4.11.0
  latest version: 4.12.0

Please update conda by running

    $ conda update -n base -c defaults conda

  environment location: /usr/local/Caskroom/miniconda/base/envs/TensorFlow2

Proceed ([y]/n)? y

Preparing transaction: done
Verifying transaction: done
Executing transaction: done

$ conda env list

base                  *  /usr/local/Caskroom/miniconda/base
TensorFlow2              /usr/local/Caskroom/miniconda/base/envs/TensorFlow2

激活虚拟环境

$ conda activate TensorFlow2

$ conda activate TensorFlow2

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

To initialize your shell, run

    $ conda init <SHELL_NAME>

Currently supported shells are:
  - bash
  - fish
  - tcsh
  - xonsh
  - zsh
  - powershell

See 'conda init --help' for more information and options.

IMPORTANT: You may need to close and restart your shell after running 'conda init'.

执行 $ conda init <shell_name></shell_name>

当前交互的shell终端是base.

$ conda init bash
no change     /usr/local/Caskroom/miniconda/base/condabin/conda
no change     /usr/local/Caskroom/miniconda/base/bin/conda
no change     /usr/local/Caskroom/miniconda/base/bin/conda-env
no change     /usr/local/Caskroom/miniconda/base/bin/activate
no change     /usr/local/Caskroom/miniconda/base/bin/deactivate
no change     /usr/local/Caskroom/miniconda/base/etc/profile.d/conda.sh
no change     /usr/local/Caskroom/miniconda/base/etc/fish/conf.d/conda.fish
no change     /usr/local/Caskroom/miniconda/base/shell/condabin/Conda.psm1
modified      /usr/local/Caskroom/miniconda/base/shell/condabin/conda-hook.ps1
no change     /usr/local/Caskroom/miniconda/base/lib/python3.9/site-packages/xontrib/conda.xsh
no change     /usr/local/Caskroom/miniconda/base/etc/profile.d/conda.csh
modified      /Users/yanghaoyuan/.bash_profile

==> For changes to take effect, close and re-open your current shell. =

新建终端命令窗口执行激活

$ conda activate TensorFlow2
(base) 在终端命令行 输出的最前面。

$ conda activate TensorFlow2

此时 (TensorFlow2)在命令行的最前面。

虚拟环境安装

$ pip -V
-bash: pip: command not found

$ conda install pip
Collecting package metadata (current_repodata.json): done
Solving environment: done

==> WARNING: A newer version of conda exists. =
  current version: 4.11.0
  latest version: 4.12.0

Please update conda by running

    $ conda update -n base -c defaults conda

  environment location: /usr/local/Caskroom/miniconda/base/envs/TensorFlow2

  added / updated specs:
    - pip

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    ca-certificates-2022.3.29  |       hecd8cb5_0         118 KB
    openssl-1.1.1n             |       hca72f7f_0         2.2 MB
    python-3.9.11              |       hdfd78df_2        10.3 MB
    sqlite-3.38.2              |       h707629a_0         1.2 MB
    tzdata-2022a               |       hda174b7_0         109 KB
    ------------------------------------------------------------
                                           Total:        13.9 MB

The following NEW packages will be INSTALLED:

  ca-certificates    pkgs/main/osx-64::ca-certificates-2022.3.29-hecd8cb5_0
  certifi            pkgs/main/osx-64::certifi-2021.10.8-py39hecd8cb5_2
  libcxx             pkgs/main/osx-64::libcxx-12.0.0-h2f01273_0
  libffi             pkgs/main/osx-64::libffi-3.3-hb1e8313_2
  ncurses            pkgs/main/osx-64::ncurses-6.3-hca72f7f_2
  openssl            pkgs/main/osx-64::openssl-1.1.1n-hca72f7f_0
  pip                pkgs/main/osx-64::pip-21.2.4-py39hecd8cb5_0
  python             pkgs/main/osx-64::python-3.9.11-hdfd78df_2
  readline           pkgs/main/osx-64::readline-8.1.2-hca72f7f_1
  setuptools         pkgs/main/osx-64::setuptools-58.0.4-py39hecd8cb5_0
  sqlite             pkgs/main/osx-64::sqlite-3.38.2-h707629a_0
  tk                 pkgs/main/osx-64::tk-8.6.11-h7bc2e8c_0
  tzdata             pkgs/main/noarch::tzdata-2022a-hda174b7_0
  wheel              pkgs/main/noarch::wheel-0.37.1-pyhd3eb1b0_0
  xz                 pkgs/main/osx-64::xz-5.2.5-h1de35cc_0
  zlib               pkgs/main/osx-64::zlib-1.2.11-h4dc903c_4

Proceed ([y]/n)? y

Downloading and Extracting Packages
python-3.9.11        | 10.3 MB   |
ca-certificates-2022 | 118 KB    |
openssl-1.1.1n       | 2.2 MB    |
tzdata-2022a         | 109 KB    |
sqlite-3.38.2        | 1.2 MB    |
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
n$ pip -V
pip 21.2.4 from /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages/pip (python 3.9)

安装 numpy jupyter notebook jupyter_contrib_nbextensions autopep8

$ pip install numpy
Collecting numpy
  Downloading numpy-1.22.3-cp39-cp39-macosx_10_14_x86_64.whl (17.6 MB)
     |████████████████████████████████| 17.6 MB 176 kB/s
Installing collected packages: numpy
Successfully installed numpy-1.22.3
$ pip install jupyter notebook
Collecting jupyter
  Downloading jupyter-1.0.0-py2.py3-none-any.whl (2.7 kB)
Collecting notebook
  Downloading notebook-6.4.10-py3-none-any.whl (9.9 MB)
     |████████████████████████████████| 9.9 MB 2.6 MB/s
Collecting ipykernel
  Downloading ipykernel-6.11.0-py3-none-any.whl (130 kB)
     |████████████████████████████████| 130 kB 5.7 MB/s
Collecting ipywidgets
  Downloading ipywidgets-7.7.0-py2.py3-none-any.whl (123 kB)
     |████████████████████████████████| 123 kB 4.2 MB/s
Collecting nbconvert
  Downloading nbconvert-6.4.5-py3-none-any.whl (561 kB)
     |████████████████████████████████| 561 kB 6.4 MB/s
Collecting qtconsole
  Downloading qtconsole-5.3.0-py3-none-any.whl (120 kB)
     |████████████████████████████████| 120 kB 2.9 MB/s
Collecting jupyter-console
  Downloading jupyter_console-6.4.3-py3-none-any.whl (22 kB)
Collecting prometheus-client
  Downloading prometheus_client-0.13.1-py3-none-any.whl (57 kB)
     |████████████████████████████████| 57 kB 2.2 MB/s
Collecting tornado>=6.1
  Downloading tornado-6.1-cp39-cp39-macosx_10_9_x86_64.whl (416 kB)
     |████████████████████████████████| 416 kB 3.0 MB/s
Collecting terminado>=0.8.3
  Downloading terminado-0.13.3-py3-none-any.whl (14 kB)
Collecting Send2Trash>=1.8.0
  Downloading Send2Trash-1.8.0-py3-none-any.whl (18 kB)
Collecting traitlets>=4.2.1
  Downloading traitlets-5.1.1-py3-none-any.whl (102 kB)
     |████████████████████████████████| 102 kB 2.1 MB/s
Collecting argon2-cffi
  Downloading argon2_cffi-21.3.0-py3-none-any.whl (14 kB)
Collecting ipython-genutils
  Downloading ipython_genutils-0.2.0-py2.py3-none-any.whl (26 kB)
Collecting jupyter-client>=5.3.4
  Downloading jupyter_client-7.2.1-py3-none-any.whl (130 kB)
     |████████████████████████████████| 130 kB 6.3 MB/s
Collecting nest-asyncio>=1.5
  Downloading nest_asyncio-1.5.4-py3-none-any.whl (5.1 kB)
Collecting jupyter-core>=4.6.1
  Downloading jupyter_core-4.9.2-py3-none-any.whl (86 kB)
     |████████████████████████████████| 86 kB 2.6 MB/s
Collecting nbformat
  Downloading nbformat-5.2.0-py3-none-any.whl (74 kB)
     |████████████████████████████████| 74 kB 1.7 MB/s
Collecting jinja2
  Downloading Jinja2-3.1.1-py3-none-any.whl (132 kB)
     |████████████████████████████████| 132 kB 3.4 MB/s
Collecting pyzmq>=17
  Downloading pyzmq-22.3.0-cp39-cp39-macosx_10_15_universal2.whl (2.0 MB)
     |████████████████████████████████| 2.0 MB 3.9 MB/s
Collecting entrypoints
  Downloading entrypoints-0.4-py3-none-any.whl (5.3 kB)
Collecting python-dateutil>=2.8.2
  Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
     |████████████████████████████████| 247 kB 4.9 MB/s
Collecting pandocfilters>=1.4.1
  Downloading pandocfilters-1.5.0-py2.py3-none-any.whl (8.7 kB)
Collecting bleach
  Downloading bleach-4.1.0-py2.py3-none-any.whl (157 kB)
     |████████████████████████████████| 157 kB 6.1 MB/s
Collecting defusedxml
  Downloading defusedxml-0.7.1-py2.py3-none-any.whl (25 kB)
Collecting mistune<2,>=0.8.1
  Downloading mistune-0.8.4-py2.py3-none-any.whl (16 kB)
Collecting MarkupSafe>=2.0
  Downloading MarkupSafe-2.1.1-cp39-cp39-macosx_10_9_x86_64.whl (13 kB)
Collecting beautifulsoup4
  Downloading beautifulsoup4-4.10.0-py3-none-any.whl (97 kB)
     |████████████████████████████████| 97 kB 2.8 MB/s
Collecting testpath
  Downloading testpath-0.6.0-py3-none-any.whl (83 kB)
     |████████████████████████████████| 83 kB 1.5 MB/s
Collecting nbclient<0.6.0,>=0.5.0
  Downloading nbclient-0.5.13-py3-none-any.whl (70 kB)
     |████████████████████████████████| 70 kB 3.5 MB/s
Collecting jupyterlab-pygments
  Downloading jupyterlab_pygments-0.1.2-py2.py3-none-any.whl (4.6 kB)
Collecting pygments>=2.4.1
  Downloading Pygments-2.11.2-py3-none-any.whl (1.1 MB)
     |████████████████████████████████| 1.1 MB 6.5 MB/s
Collecting jsonschema!=2.5.0,>=2.4
  Downloading jsonschema-4.4.0-py3-none-any.whl (72 kB)
     |████████████████████████████████| 72 kB 712 kB/s
Collecting pyrsistent!=0.17.0,!=0.17.1,!=0.17.2,>=0.14.0
  Downloading pyrsistent-0.18.1-cp39-cp39-macosx_10_9_universal2.whl (81 kB)
     |████████████████████████████████| 81 kB 2.9 MB/s
Collecting attrs>=17.4.0
  Downloading attrs-21.4.0-py2.py3-none-any.whl (60 kB)
     |████████████████████████████████| 60 kB 2.6 MB/s
Collecting six>=1.5
  Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting ptyprocess
  Downloading ptyprocess-0.7.0-py2.py3-none-any.whl (13 kB)
Collecting argon2-cffi-bindings
  Downloading argon2_cffi_bindings-21.2.0-cp38-abi3-macosx_10_9_universal2.whl (53 kB)
     |████████████████████████████████| 53 kB 835 kB/s
Collecting cffi>=1.0.1
  Downloading cffi-1.15.0-cp39-cp39-macosx_10_9_x86_64.whl (178 kB)
     |████████████████████████████████| 178 kB 710 kB/s
Collecting pycparser
  Downloading pycparser-2.21-py2.py3-none-any.whl (118 kB)
     |████████████████████████████████| 118 kB 4.4 MB/s
Collecting soupsieve>1.2
  Downloading soupsieve-2.3.1-py3-none-any.whl (37 kB)
Collecting webencodings
  Downloading webencodings-0.5.1-py2.py3-none-any.whl (11 kB)
Collecting packaging
  Downloading packaging-21.3-py3-none-any.whl (40 kB)
     |████████████████████████████████| 40 kB 2.2 MB/s
Collecting appnope
  Downloading appnope-0.1.2-py2.py3-none-any.whl (4.3 kB)
Collecting psutil
  Downloading psutil-5.9.0-cp39-cp39-macosx_10_9_x86_64.whl (238 kB)
     |████████████████████████████████| 238 kB 3.5 MB/s
Collecting debugpy>=1.0
  Downloading debugpy-1.6.0-cp39-cp39-macosx_10_15_x86_64.whl (1.7 MB)
     |████████████████████████████████| 1.7 MB 3.7 MB/s
Collecting ipython>=7.23.1
  Downloading ipython-8.2.0-py3-none-any.whl (750 kB)
     |████████████████████████████████| 750 kB 3.7 MB/s
Collecting setuptools>=60
  Downloading setuptools-61.3.0-py3-none-any.whl (1.1 MB)
     |████████████████████████████████| 1.1 MB 3.4 MB/s
Collecting matplotlib-inline>=0.1
  Downloading matplotlib_inline-0.1.3-py3-none-any.whl (8.2 kB)
Collecting stack-data
  Downloading stack_data-0.2.0-py3-none-any.whl (21 kB)
Collecting jedi>=0.16
  Downloading jedi-0.18.1-py2.py3-none-any.whl (1.6 MB)
     |████████████████████████████████| 1.6 MB 3.6 MB/s
Collecting prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0
  Downloading prompt_toolkit-3.0.28-py3-none-any.whl (380 kB)
     |████████████████████████████████| 380 kB 2.0 MB/s
Collecting pexpect>4.3
  Downloading pexpect-4.8.0-py2.py3-none-any.whl (59 kB)
     |████████████████████████████████| 59 kB 1.8 MB/s
Collecting decorator
  Downloading decorator-5.1.1-py3-none-any.whl (9.1 kB)
Collecting backcall
  Downloading backcall-0.2.0-py2.py3-none-any.whl (11 kB)
Collecting pickleshare
  Downloading pickleshare-0.7.5-py2.py3-none-any.whl (6.9 kB)
Collecting parso<0.9.0,>=0.8.0
  Downloading parso-0.8.3-py2.py3-none-any.whl (100 kB)
     |████████████████████████████████| 100 kB 2.2 MB/s
Collecting wcwidth
  Downloading wcwidth-0.2.5-py2.py3-none-any.whl (30 kB)
Collecting jupyterlab-widgets>=1.0.0
  Downloading jupyterlab_widgets-1.1.0-py3-none-any.whl (245 kB)
     |████████████████████████████████| 245 kB 2.2 MB/s
Collecting widgetsnbextension~=3.6.0
  Downloading widgetsnbextension-3.6.0-py2.py3-none-any.whl (1.6 MB)
     |████████████████████████████████| 1.6 MB 3.2 MB/s
Collecting pyparsing!=3.0.5,>=2.0.2
  Downloading pyparsing-3.0.7-py3-none-any.whl (98 kB)
     |████████████████████████████████| 98 kB 2.0 MB/s
Collecting qtpy>=2.0.1
  Downloading QtPy-2.0.1-py3-none-any.whl (65 kB)
     |████████████████████████████████| 65 kB 2.1 MB/s
Collecting asttokens
  Downloading asttokens-2.0.5-py2.py3-none-any.whl (20 kB)
Collecting pure-eval
  Downloading pure_eval-0.2.2-py3-none-any.whl (11 kB)
Collecting executing
  Downloading executing-0.8.3-py2.py3-none-any.whl (16 kB)
Installing collected packages: traitlets, six, pyrsistent, attrs, wcwidth, tornado, pyzmq, python-dateutil, pyparsing, pycparser, pure-eval, ptyprocess, parso, nest-asyncio, jupyter-core, jsonschema, executing, entrypoints, asttokens, webencodings, stack-data, soupsieve, setuptools, pygments, prompt-toolkit, pickleshare, pexpect, packaging, nbformat, matplotlib-inline, MarkupSafe, jupyter-client, jedi, decorator, cffi, backcall, appnope, testpath, psutil, pandocfilters, nbclient, mistune, jupyterlab-pygments, jinja2, ipython, defusedxml, debugpy, bleach, beautifulsoup4, argon2-cffi-bindings, terminado, Send2Trash, prometheus-client, nbconvert, ipython-genutils, ipykernel, argon2-cffi, notebook, widgetsnbextension, qtpy, jupyterlab-widgets, qtconsole, jupyter-console, ipywidgets, jupyter
  Attempting uninstall: setuptools
    Found existing installation: setuptools 58.0.4
    Uninstalling setuptools-58.0.4:
      Successfully uninstalled setuptools-58.0.4
Successfully installed MarkupSafe-2.1.1 Send2Trash-1.8.0 appnope-0.1.2 argon2-cffi-21.3.0 argon2-cffi-bindings-21.2.0 asttokens-2.0.5 attrs-21.4.0 backcall-0.2.0 beautifulsoup4-4.10.0 bleach-4.1.0 cffi-1.15.0 debugpy-1.6.0 decorator-5.1.1 defusedxml-0.7.1 entrypoints-0.4 executing-0.8.3 ipykernel-6.11.0 ipython-8.2.0 ipython-genutils-0.2.0 ipywidgets-7.7.0 jedi-0.18.1 jinja2-3.1.1 jsonschema-4.4.0 jupyter-1.0.0 jupyter-client-7.2.1 jupyter-console-6.4.3 jupyter-core-4.9.2 jupyterlab-pygments-0.1.2 jupyterlab-widgets-1.1.0 matplotlib-inline-0.1.3 mistune-0.8.4 nbclient-0.5.13 nbconvert-6.4.5 nbformat-5.2.0 nest-asyncio-1.5.4 notebook-6.4.10 packaging-21.3 pandocfilters-1.5.0 parso-0.8.3 pexpect-4.8.0 pickleshare-0.7.5 prometheus-client-0.13.1 prompt-toolkit-3.0.28 psutil-5.9.0 ptyprocess-0.7.0 pure-eval-0.2.2 pycparser-2.21 pygments-2.11.2 pyparsing-3.0.7 pyrsistent-0.18.1 python-dateutil-2.8.2 pyzmq-22.3.0 qtconsole-5.3.0 qtpy-2.0.1 setuptools-61.3.0 six-1.16.0 soupsieve-2.3.1 stack-data-0.2.0 terminado-0.13.3 testpath-0.6.0 tornado-6.1 traitlets-5.1.1 wcwidth-0.2.5 webencodings-0.5.1 widgetsnbextension-3.6.0
$ pip install jupyter_contrib_nbextensions autopep8
Collecting jupyter_contrib_nbextensions
  Downloading jupyter_contrib_nbextensions-0.5.1-py2.py3-none-any.whl (20.9 MB)
     |▌                               | 358 kB 21 kB/s eta 0:16:12^C
ERROR: Operation cancelled by user

由于国外镜像源下载速度慢我们指定安装源用-i参数 $ pip install jupyter_contrib_nbextensions autopep8 -i "https://mirrors.aliyun.com/pypi/simple"

$ pip install jupyter_contrib_nbextensions autopep8 -i "https://mirrors.aliyun.com/pypi/simple"
Looking in indexes: https://mirrors.aliyun.com/pypi/simple
Collecting jupyter_contrib_nbextensions
  Downloading https://mirrors.aliyun.com/pypi/packages/33/f0/6e2c00afda860f655fbf0f795f7310bdbf12122846344dfdc803fc7455d5/jupyter_contrib_nbextensions-0.5.1-py2.py3-none-any.whl (20.9 MB)
     |████████████████████████████████| 20.9 MB 1.6 MB/s
Collecting autopep8
  Downloading https://mirrors.aliyun.com/pypi/packages/39/3a/cd60ecce0d9737efefc06a074ae280a5d0e904d697fe59b414bf8ab5c472/autopep8-1.6.0-py2.py3-none-any.whl (45 kB)
     |████████████████████████████████| 45 kB 757 kB/s
Requirement already satisfied: tornado in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from jupyter_contrib_nbextensions) (6.1)
Requirement already satisfied: traitlets>=4.1 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from jupyter_contrib_nbextensions) (5.1.1)
Requirement already satisfied: nbconvert>=4.2 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from jupyter_contrib_nbextensions) (6.4.5)
Collecting jupyter-nbextensions-configurator>=0.4.0
  Downloading https://mirrors.aliyun.com/pypi/packages/51/a3/d72d5f2dc10c5ccf5a6f4c79f636bf071a5ce462dedd07af2f70384db6cb/jupyter_nbextensions_configurator-0.4.1.tar.gz (479 kB)
     |████████████████████████████████| 479 kB 1.4 MB/s
Collecting jupyter-highlight-selected-word>=0.1.1
  Downloading https://mirrors.aliyun.com/pypi/packages/50/d7/19ab7cfd60bf268d2abbacc52d4295a40f52d74dfc0d938e4761ee5e598b/jupyter_highlight_selected_word-0.2.0-py2.py3-none-any.whl (11 kB)
Collecting pyyaml
  Downloading https://mirrors.aliyun.com/pypi/packages/f5/6f/b8b4515346af7c33d3b07cd8ca8ea0700ca72e8d7a750b2b87ac0268ca4e/PyYAML-6.0-cp39-cp39-macosx_10_9_x86_64.whl (197 kB)
     |████████████████████████████████| 197 kB 1.6 MB/s
Requirement already satisfied: ipython-genutils in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from jupyter_contrib_nbextensions) (0.2.0)
Collecting jupyter-contrib-core>=0.3.3
  Downloading https://mirrors.aliyun.com/pypi/packages/e6/8f/04a752a8b66a66e7092c035e5d87d2502ac7ec07f9fb6059059b6c0dc272/jupyter_contrib_core-0.3.3-py2.py3-none-any.whl (18 kB)
Requirement already satisfied: notebook>=4.0 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from jupyter_contrib_nbextensions) (6.4.10)
Collecting lxml
  Downloading https://mirrors.aliyun.com/pypi/packages/19/28/ad90ac0ae2688355770391d81f2df6c7100f77df66a3f9c988e07d820d92/lxml-4.8.0-cp39-cp39-macosx_10_15_x86_64.whl (4.6 MB)
     |████████████████████████████████| 4.6 MB 1.6 MB/s
Collecting jupyter-latex-envs>=1.3.8
  Downloading https://mirrors.aliyun.com/pypi/packages/0e/15/55805de080d5542f76920364635e96e64d3b37f678befdfe3b16aa154205/jupyter_latex_envs-1.4.6.tar.gz (861 kB)
     |████████████████████████████████| 861 kB 1.4 MB/s
Requirement already satisfied: jupyter-core in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from jupyter_contrib_nbextensions) (4.9.2)
Collecting pycodestyle>=2.8.0
  Downloading https://mirrors.aliyun.com/pypi/packages/15/94/bc43a2efb7b8615e38acde2b6624cae8c9ec86faf718ff5676c5179a7714/pycodestyle-2.8.0-py2.py3-none-any.whl (42 kB)
     |████████████████████████████████| 42 kB 1.1 MB/s
Collecting toml
  Downloading https://mirrors.aliyun.com/pypi/packages/44/6f/7120676b6d73228c96e17f1f794d8ab046fc910d781c8d151120c3f1569e/toml-0.10.2-py2.py3-none-any.whl (16 kB)
Requirement already satisfied: setuptools in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from jupyter-contrib-core>=0.3.3->jupyter_contrib_nbextensions) (61.3.0)
Requirement already satisfied: ipython in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from jupyter-latex-envs>=1.3.8->jupyter_contrib_nbextensions) (8.2.0)
Requirement already satisfied: jupyterlab-pygments in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from nbconvert>=4.2->jupyter_contrib_nbextensions) (0.1.2)
Requirement already satisfied: jinja2>=2.4 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from nbconvert>=4.2->jupyter_contrib_nbextensions) (3.1.1)
Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from nbconvert>=4.2->jupyter_contrib_nbextensions) (2.1.1)
Requirement already satisfied: nbclient<0.6.0,>=0.5.0 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from nbconvert>=4.2->jupyter_contrib_nbextensions) (0.5.13)
Requirement already satisfied: pandocfilters>=1.4.1 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from nbconvert>=4.2->jupyter_contrib_nbextensions) (1.5.0)
Requirement already satisfied: testpath in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from nbconvert>=4.2->jupyter_contrib_nbextensions) (0.6.0)
Requirement already satisfied: entrypoints>=0.2.2 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from nbconvert>=4.2->jupyter_contrib_nbextensions) (0.4)
Requirement already satisfied: defusedxml in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from nbconvert>=4.2->jupyter_contrib_nbextensions) (0.7.1)
Requirement already satisfied: beautifulsoup4 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from nbconvert>=4.2->jupyter_contrib_nbextensions) (4.10.0)
Requirement already satisfied: pygments>=2.4.1 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from nbconvert>=4.2->jupyter_contrib_nbextensions) (2.11.2)
Requirement already satisfied: bleach in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from nbconvert>=4.2->jupyter_contrib_nbextensions) (4.1.0)
Requirement already satisfied: nbformat>=4.4 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from nbconvert>=4.2->jupyter_contrib_nbextensions) (5.2.0)
Requirement already satisfied: mistune<2,>=0.8.1 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from nbconvert>=4.2->jupyter_contrib_nbextensions) (0.8.4)
Requirement already satisfied: nest-asyncio in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from nbclient<0.6.0,>=0.5.0->nbconvert>=4.2->jupyter_contrib_nbextensions) (1.5.4)
Requirement already satisfied: jupyter-client>=6.1.5 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from nbclient<0.6.0,>=0.5.0->nbconvert>=4.2->jupyter_contrib_nbextensions) (7.2.1)
Requirement already satisfied: pyzmq>=22.3 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from jupyter-client>=6.1.5->nbclient<0.6.0,>=0.5.0->nbconvert>=4.2->jupyter_contrib_nbextensions) (22.3.0)
Requirement already satisfied: python-dateutil>=2.8.2 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from jupyter-client>=6.1.5->nbclient<0.6.0,>=0.5.0->nbconvert>=4.2->jupyter_contrib_nbextensions) (2.8.2)
Requirement already satisfied: jsonschema!=2.5.0,>=2.4 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from nbformat>=4.4->nbconvert>=4.2->jupyter_contrib_nbextensions) (4.4.0)
Requirement already satisfied: pyrsistent!=0.17.0,!=0.17.1,!=0.17.2,>=0.14.0 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from jsonschema!=2.5.0,>=2.4->nbformat>=4.4->nbconvert>=4.2->jupyter_contrib_nbextensions) (0.18.1)
Requirement already satisfied: attrs>=17.4.0 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from jsonschema!=2.5.0,>=2.4->nbformat>=4.4->nbconvert>=4.2->jupyter_contrib_nbextensions) (21.4.0)
Requirement already satisfied: argon2-cffi in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from notebook>=4.0->jupyter_contrib_nbextensions) (21.3.0)
Requirement already satisfied: Send2Trash>=1.8.0 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from notebook>=4.0->jupyter_contrib_nbextensions) (1.8.0)
Requirement already satisfied: prometheus-client in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from notebook>=4.0->jupyter_contrib_nbextensions) (0.13.1)
Requirement already satisfied: ipykernel in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from notebook>=4.0->jupyter_contrib_nbextensions) (6.11.0)
Requirement already satisfied: terminado>=0.8.3 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from notebook>=4.0->jupyter_contrib_nbextensions) (0.13.3)
Requirement already satisfied: six>=1.5 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from python-dateutil>=2.8.2->jupyter-client>=6.1.5->nbclient<0.6.0,>=0.5.0->nbconvert>=4.2->jupyter_contrib_nbextensions) (1.16.0)
Requirement already satisfied: ptyprocess in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from terminado>=0.8.3->notebook>=4.0->jupyter_contrib_nbextensions) (0.7.0)
Requirement already satisfied: argon2-cffi-bindings in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from argon2-cffi->notebook>=4.0->jupyter_contrib_nbextensions) (21.2.0)
Requirement already satisfied: cffi>=1.0.1 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from argon2-cffi-bindings->argon2-cffi->notebook>=4.0->jupyter_contrib_nbextensions) (1.15.0)
Requirement already satisfied: pycparser in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from cffi>=1.0.1->argon2-cffi-bindings->argon2-cffi->notebook>=4.0->jupyter_contrib_nbextensions) (2.21)
Requirement already satisfied: soupsieve>1.2 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from beautifulsoup4->nbconvert>=4.2->jupyter_contrib_nbextensions) (2.3.1)
Requirement already satisfied: webencodings in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from bleach->nbconvert>=4.2->jupyter_contrib_nbextensions) (0.5.1)
Requirement already satisfied: packaging in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from bleach->nbconvert>=4.2->jupyter_contrib_nbextensions) (21.3)
Requirement already satisfied: psutil in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from ipykernel->notebook>=4.0->jupyter_contrib_nbextensions) (5.9.0)
Requirement already satisfied: matplotlib-inline>=0.1 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from ipykernel->notebook>=4.0->jupyter_contrib_nbextensions) (0.1.3)
Requirement already satisfied: appnope in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from ipykernel->notebook>=4.0->jupyter_contrib_nbextensions) (0.1.2)
Requirement already satisfied: debugpy>=1.0 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from ipykernel->notebook>=4.0->jupyter_contrib_nbextensions) (1.6.0)
Requirement already satisfied: pickleshare in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from ipython->jupyter-latex-envs>=1.3.8->jupyter_contrib_nbextensions) (0.7.5)
Requirement already satisfied: pexpect>4.3 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from ipython->jupyter-latex-envs>=1.3.8->jupyter_contrib_nbextensions) (4.8.0)
Requirement already satisfied: decorator in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from ipython->jupyter-latex-envs>=1.3.8->jupyter_contrib_nbextensions) (5.1.1)
Requirement already satisfied: backcall in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from ipython->jupyter-latex-envs>=1.3.8->jupyter_contrib_nbextensions) (0.2.0)
Requirement already satisfied: stack-data in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from ipython->jupyter-latex-envs>=1.3.8->jupyter_contrib_nbextensions) (0.2.0)
Requirement already satisfied: prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from ipython->jupyter-latex-envs>=1.3.8->jupyter_contrib_nbextensions) (3.0.28)
Requirement already satisfied: jedi>=0.16 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from ipython->jupyter-latex-envs>=1.3.8->jupyter_contrib_nbextensions) (0.18.1)
Requirement already satisfied: parso<0.9.0,>=0.8.0 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from jedi>=0.16->ipython->jupyter-latex-envs>=1.3.8->jupyter_contrib_nbextensions) (0.8.3)
Requirement already satisfied: wcwidth in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0->ipython->jupyter-latex-envs>=1.3.8->jupyter_contrib_nbextensions) (0.2.5)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from packaging->bleach->nbconvert>=4.2->jupyter_contrib_nbextensions) (3.0.7)
Requirement already satisfied: executing in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from stack-data->ipython->jupyter-latex-envs>=1.3.8->jupyter_contrib_nbextensions) (0.8.3)
Requirement already satisfied: pure-eval in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from stack-data->ipython->jupyter-latex-envs>=1.3.8->jupyter_contrib_nbextensions) (0.2.2)
Requirement already satisfied: asttokens in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from stack-data->ipython->jupyter-latex-envs>=1.3.8->jupyter_contrib_nbextensions) (2.0.5)
Building wheels for collected packages: jupyter-latex-envs, jupyter-nbextensions-configurator
  Building wheel for jupyter-latex-envs (setup.py) ... done
  Created wheel for jupyter-latex-envs: filename=jupyter_latex_envs-1.4.6-py2.py3-none-any.whl size=963413 sha256=c54f609b8ada3cc122831539f461e1b68d74bc840ce579f2a9045a438c44e895
  Stored in directory: /Users/yanghaoyuan/Library/Caches/pip/wheels/e7/42/7a/df294d086be7c357fdca94cde2f8996eb71131a5d9f51d84cf
  Building wheel for jupyter-nbextensions-configurator (setup.py) ... done
  Created wheel for jupyter-nbextensions-configurator: filename=jupyter_nbextensions_configurator-0.4.1-py2.py3-none-any.whl size=465844 sha256=59b898dc7f3eaacc7651ab490eab8ff78581ddef65218044ce770f1da8659c23
  Stored in directory: /Users/yanghaoyuan/Library/Caches/pip/wheels/98/f7/67/d39910b778e204913191c562ad4b76416586a18dd49588342b
Successfully built jupyter-latex-envs jupyter-nbextensions-configurator
Installing collected packages: pyyaml, jupyter-contrib-core, toml, pycodestyle, lxml, jupyter-nbextensions-configurator, jupyter-latex-envs, jupyter-highlight-selected-word, jupyter-contrib-nbextensions, autopep8
Successfully installed autopep8-1.6.0 jupyter-contrib-core-0.3.3 jupyter-contrib-nbextensions-0.5.1 jupyter-highlight-selected-word-0.2.0 jupyter-latex-envs-1.4.6 jupyter-nbextensions-configurator-0.4.1 lxml-4.8.0 pycodestyle-2.8.0 pyyaml-6.0 toml-0.10.2

安装notebook扩展 $ jupyter contrib nbextension install --user

$ jupyter contrib nbextension install --user
[I 18:30:41 InstallContribNbextensionsApp] jupyter contrib nbextension install --user
[I 18:30:41 InstallContribNbextensionsApp] Installing jupyter_contrib_nbextensions nbextension files to jupyter data directory
[I 18:30:41 InstallContribNbextensionsApp] Installing /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages/jupyter_contrib_nbextensions/nbextensions/rubberband -> rubberband

> 后面的输出省略...

查看jupyter 安装版本命令 $ jupyter --version
$ jupyter --version
Selected Jupyter core packages...

IPython          : 8.2.0
ipykernel        : 6.11.0
ipywidgets       : 7.7.0
jupyter_client   : 7.2.1
jupyter_core     : 4.9.2
jupyter_server   : not installed
jupyterlab       : not installed
nbclient         : 0.5.13
nbconvert        : 6.4.5
nbformat         : 5.2.0
notebook         : 6.4.10
qtconsole        : 5.3.0
traitlets        : 5.1.1

打开 jupyter notebook $ jupyter notebook

 $ jupyter notebook
[I 11:35:15.368 NotebookApp] 把notebook服务器的cookie密码写入 /Users/yanghaoyuan/Library/Jupyter/runtime/notebook_cookie_secret
[I 11:35:15.940 NotebookApp] [jupyter_nbextensions_configurator] enabled 0.4.1
[I 11:35:15.948 NotebookApp] notebooks 运行所在的本地路径: /Users/yanghaoyuan
[I 11:35:15.948 NotebookApp] Jupyter Notebook 6.4.10 is running at:
[I 11:35:15.948 NotebookApp] http://localhost:8888/?token=d751a61dcc258ffcf27d0a806cf76c3d220984e5bc1b7899
[I 11:35:15.948 NotebookApp]  or http://127.0.0.1:8888/?token=d751a61dcc258ffcf27d0a806cf76c3d220984e5bc1b7899
[I 11:35:15.948 NotebookApp] 使用 Control-C 停止此服务器并关闭所有内核(连续操作两次便可跳过确认界面)。
[C 18:37:27.516 NotebookApp]

    To access the notebook, open this file in a browser:
        file:///Users/yanghaoyuan/Library/Jupyter/runtime/nbserver-58839-open.html
    Or copy and paste one of these URLs:
        http://localhost:8888/?token=72faccefe30e5b887f4e4a88d0a76708a769694dae3d7d40
     or http://127.0.0.1:8888/?token=72faccefe30e5b887f4e4a88d0a76708a769694dae3d7d40

MacOS 使用miniconda 虚拟环境 TensorFlow深度学习环境
MacOS 使用miniconda 虚拟环境 TensorFlow深度学习环境

CTRL + C 停止执行的进程

[I 18:50:21.455 NotebookApp] 中断
notebooks 运行所在的本地路径: /Users/yanghaoyuan
0 活跃的内核
Jupyter Notebook 6.4.10 is running at:
http://localhost:8888/?token=72faccefe30e5b887f4e4a88d0a76708a769694dae3d7d40
 or http://127.0.0.1:8888/?token=72faccefe30e5b887f4e4a88d0a76708a769694dae3d7d40
关闭这个notebook服务器 (y/[n])y
[C 18:50:38.780 NotebookApp] 确认关闭
[I 18:50:38.781 NotebookApp] 关闭 0 内核
[I 18:50:38.782 NotebookApp] Shutting down 0 terminals

提示: terminals 可以在页面上新建

列出当前正在运行的 notebook $ jupyter notebook list

$ jupyter notebook list
Currently running servers:

安装TensorFlow

pip install tensorflow -i "https://mirrors.aliyun.com/pypi/simple"

$ pip install tensorflow -i "https://mirrors.aliyun.com/pypi/simple"
Looking in indexes: https://mirrors.aliyun.com/pypi/simple
Collecting tensorflow
  Downloading https://mirrors.aliyun.com/pypi/packages/80/26/2990ee24ea5ef5ece557828ce295abc75e5b6c0c8ebf571a842f6e1125db/tensorflow-2.8.0-cp39-cp39-macosx_10_14_x86_64.whl (217.5 MB)
     |████████████████████████████████| 217.5 MB 29 kB/s
Collecting wrapt>=1.11.0
  Downloading https://mirrors.aliyun.com/pypi/packages/ec/6d/9fe8b81da26c70366ed7ab0429fa2a52c101918a85c1d1dfd56fab55a233/wrapt-1.14.0-cp39-cp39-macosx_10_9_x86_64.whl (35 kB)
Requirement already satisfied: six>=1.12.0 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from tensorflow) (1.16.0)
Collecting keras-preprocessing>=1.1.1
  Downloading https://mirrors.aliyun.com/pypi/packages/79/4c/7c3275a01e12ef9368a892926ab932b33bb13d55794881e3573482b378a7/Keras_Preprocessing-1.1.2-py2.py3-none-any.whl (42 kB)
     |████████████████████████████████| 42 kB 1.3 MB/s
Collecting termcolor>=1.1.0
  Downloading https://mirrors.aliyun.com/pypi/packages/8a/48/a76be51647d0eb9f10e2a4511bf3ffb8cc1e6b14e9e4fab46173aa79f981/termcolor-1.1.0.tar.gz (3.9 kB)
Collecting h5py>=2.9.0
  Downloading https://mirrors.aliyun.com/pypi/packages/d9/4b/65a107682a5df28e4deb1d17d53c980bdae0ce30325c005262bad351c8d3/h5py-3.6.0-cp39-cp39-macosx_10_9_x86_64.whl (3.1 MB)
     |████████████████████████████████| 3.1 MB 1.3 MB/s
Collecting absl-py>=0.4.0
  Downloading https://mirrors.aliyun.com/pypi/packages/2c/03/e3e19d3faf430ede32e41221b294e37952e06acc96781c417ac25d4a0324/absl_py-1.0.0-py3-none-any.whl (126 kB)
     |████████████████████████████████| 126 kB 3.2 MB/s
Collecting tensorflow-io-gcs-filesystem>=0.23.1
  Downloading https://mirrors.aliyun.com/pypi/packages/79/9f/c74c4710cd696b35e625e278c34d96c60cc4eaa466fc7679c7d09e8dfa41/tensorflow_io_gcs_filesystem-0.24.0-cp39-cp39-macosx_10_14_x86_64.whl (1.6 MB)
     |████████████████████████████████| 1.6 MB 1.1 MB/s
Collecting libclang>=9.0.1
  Downloading https://mirrors.aliyun.com/pypi/packages/e3/f4/5199b9aa077d9852a13bdd6e89170a4f493fa03597ce083815472f98f059/libclang-13.0.0-py2.py3-none-macosx_10_9_x86_64.whl (13.0 MB)
     |████████████████████████████████| 13.0 MB 2.9 MB/s
Collecting tf-estimator-nightly==2.8.0.dev2021122109
  Downloading https://mirrors.aliyun.com/pypi/packages/a7/f1/f89e097f377b163856076f167baf149b010df3bbf425d2c06276048e2051/tf_estimator_nightly-2.8.0.dev2021122109-py2.py3-none-any.whl (462 kB)
     |████████████████████████████████| 462 kB 4.4 MB/s
Collecting tensorboard<2.9,>=2.8
  Downloading https://mirrors.aliyun.com/pypi/packages/f7/fd/67c61276de025801cfa8a1b9af2d7c577e7f27c17b6bff2baca20bf03543/tensorboard-2.8.0-py3-none-any.whl (5.8 MB)
     |████████████████████████████████| 5.8 MB 1.7 MB/s
Collecting keras<2.9,>=2.8.0rc0
  Downloading https://mirrors.aliyun.com/pypi/packages/4f/2f/eb9391bdcba2693cc8396f244bd3b4512bcd1123c2ea06f4dfcf50dc5ce9/keras-2.8.0-py2.py3-none-any.whl (1.4 MB)
     |████████████████████████████████| 1.4 MB 3.0 MB/s
Collecting grpcio<2.0,>=1.24.3
  Downloading https://mirrors.aliyun.com/pypi/packages/46/8e/8700fa890a4df73410306fe3a02b4d99ea34592cbd89abc10f04f5c66a68/grpcio-1.45.0-cp39-cp39-macosx_10_10_x86_64.whl (4.3 MB)
     |████████████████████████████████| 4.3 MB 1.7 MB/s
Collecting google-pasta>=0.1.1
  Downloading https://mirrors.aliyun.com/pypi/packages/a3/de/c648ef6835192e6e2cc03f40b19eeda4382c49b5bafb43d88b931c4c74ac/google_pasta-0.2.0-py3-none-any.whl (57 kB)
     |████████████████████████████████| 57 kB 1.7 MB/s
Collecting flatbuffers>=1.12
  Downloading https://mirrors.aliyun.com/pypi/packages/3d/d0/26033c70d642fbc1e35d3619cf3210986fb953c173b1226709f75056c149/flatbuffers-2.0-py2.py3-none-any.whl (26 kB)
Collecting astunparse>=1.6.0
  Downloading https://mirrors.aliyun.com/pypi/packages/2b/03/13dde6512ad7b4557eb792fbcf0c653af6076b81e5941d36ec61f7ce6028/astunparse-1.6.3-py2.py3-none-any.whl (12 kB)
Requirement already satisfied: numpy>=1.20 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from tensorflow) (1.22.3)
Collecting opt-einsum>=2.3.2
  Downloading https://mirrors.aliyun.com/pypi/packages/bc/19/404708a7e54ad2798907210462fd950c3442ea51acc8790f3da48d2bee8b/opt_einsum-3.3.0-py3-none-any.whl (65 kB)
     |████████████████████████████████| 65 kB 1.5 MB/s
Collecting protobuf>=3.9.2
  Downloading https://mirrors.aliyun.com/pypi/packages/93/c3/74ef6aec31eadfe54c1b5351d7dd59cb49e19e6d56ffd52b9f8e9589f911/protobuf-3.19.4-cp39-cp39-macosx_10_9_x86_64.whl (961 kB)
     |████████████████████████████████| 961 kB 1.8 MB/s
Collecting typing-extensions>=3.6.6
  Downloading https://mirrors.aliyun.com/pypi/packages/45/6b/44f7f8f1e110027cf88956b59f2fad776cca7e1704396d043f89effd3a0e/typing_extensions-4.1.1-py3-none-any.whl (26 kB)
Requirement already satisfied: setuptools in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from tensorflow) (61.3.0)
Collecting gast>=0.2.1
  Downloading https://mirrors.aliyun.com/pypi/packages/5f/1c/b59500a88c5c3d9d601c5ca62b9df5e0964764472faed82a182958a922c5/gast-0.5.3-py3-none-any.whl (19 kB)
Requirement already satisfied: wheel<1.0,>=0.23.0 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from astunparse>=1.6.0->tensorflow) (0.37.1)
Collecting tensorboard-data-server<0.7.0,>=0.6.0
  Downloading https://mirrors.aliyun.com/pypi/packages/3e/48/dd135dbb3cf16bfb923720163493cab70e7336db4b5f3103d49efa730404/tensorboard_data_server-0.6.1-py3-none-macosx_10_9_x86_64.whl (3.5 MB)
     |████████████████████████████████| 3.5 MB 2.5 MB/s
Collecting google-auth<3,>=1.6.3
  Downloading https://mirrors.aliyun.com/pypi/packages/21/6c/e784c6883689fae9d1c5f82d995ddc82c284daa514edd5ba67ea38d88341/google_auth-2.6.2-py2.py3-none-any.whl (156 kB)
     |████████████████████████████████| 156 kB 3.2 MB/s
Collecting markdown>=2.6.8
  Downloading https://mirrors.aliyun.com/pypi/packages/9f/d4/2c7f83915d437736996b2674300c6c4b578a6f897f34e40f5c04db146719/Markdown-3.3.6-py3-none-any.whl (97 kB)
     |████████████████████████████████| 97 kB 2.3 MB/s
Collecting werkzeug>=0.11.15
  Downloading https://mirrors.aliyun.com/pypi/packages/dc/67/8b93ea73e9d3b2fb1761a589f1554d0ab156a0f960f3d23b4a79a70de49b/Werkzeug-2.1.0-py3-none-any.whl (224 kB)
     |████████████████████████████████| 224 kB 2.6 MB/s
Collecting requests<3,>=2.21.0
  Downloading https://mirrors.aliyun.com/pypi/packages/2d/61/08076519c80041bc0ffa1a8af0cbd3bf3e2b62af10435d269a9d0f40564d/requests-2.27.1-py2.py3-none-any.whl (63 kB)
     |████████████████████████████████| 63 kB 738 kB/s
Collecting google-auth-oauthlib<0.5,>=0.4.1
  Downloading https://mirrors.aliyun.com/pypi/packages/b1/0e/0636cc1448a7abc444fb1b3a63655e294e0d2d49092dc3de05241be6d43c/google_auth_oauthlib-0.4.6-py2.py3-none-any.whl (18 kB)
Collecting tensorboard-plugin-wit>=1.6.0
  Downloading https://mirrors.aliyun.com/pypi/packages/e0/68/e8ecfac5dd594b676c23a7f07ea34c197d7d69b3313afdf8ac1b0a9905a2/tensorboard_plugin_wit-1.8.1-py3-none-any.whl (781 kB)
     |████████████████████████████████| 781 kB 2.7 MB/s
Collecting cachetools<6.0,>=2.0.0
  Downloading https://mirrors.aliyun.com/pypi/packages/19/99/ace1769546388976b45e93445bb04c6df95e96363f03fbb56f916da5ebde/cachetools-5.0.0-py3-none-any.whl (9.1 kB)
Collecting rsa<5,>=3.1.4
  Downloading https://mirrors.aliyun.com/pypi/packages/30/ab/8fd9e88e6fa5ec41afca995938bbefb72195278e0cfc5bd76a4f29b23fb2/rsa-4.8-py3-none-any.whl (39 kB)
Collecting pyasn1-modules>=0.2.1
  Downloading https://mirrors.aliyun.com/pypi/packages/95/de/214830a981892a3e286c3794f41ae67a4495df1108c3da8a9f62159b9a9d/pyasn1_modules-0.2.8-py2.py3-none-any.whl (155 kB)
     |████████████████████████████████| 155 kB 1.8 MB/s
Collecting requests-oauthlib>=0.7.0
  Downloading https://mirrors.aliyun.com/pypi/packages/6f/bb/5deac77a9af870143c684ab46a7934038a53eb4aa975bc0687ed6ca2c610/requests_oauthlib-1.3.1-py2.py3-none-any.whl (23 kB)
Collecting importlib-metadata>=4.4
  Downloading https://mirrors.aliyun.com/pypi/packages/92/f2/c48787ca7d1e20daa185e1b6b2d4e16acd2fb5e0320bc50ffc89b91fa4d7/importlib_metadata-4.11.3-py3-none-any.whl (18 kB)
Collecting zipp>=0.5
  Downloading https://mirrors.aliyun.com/pypi/packages/52/c5/df7953fe6065185af5956265e3b16f13c2826c2b1ba23d43154f3af453bc/zipp-3.7.0-py3-none-any.whl (5.3 kB)
Collecting pyasn1<0.5.0,>=0.4.6
  Downloading https://mirrors.aliyun.com/pypi/packages/62/1e/a94a8d635fa3ce4cfc7f506003548d0a2447ae76fd5ca53932970fe3053f/pyasn1-0.4.8-py2.py3-none-any.whl (77 kB)
     |████████████████████████████████| 77 kB 1.8 MB/s
Collecting charset-normalizer~=2.0.0
  Downloading https://mirrors.aliyun.com/pypi/packages/06/b3/24afc8868eba069a7f03650ac750a778862dc34941a4bebeb58706715726/charset_normalizer-2.0.12-py3-none-any.whl (39 kB)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from requests<3,>=2.21.0->tensorboard<2.9,>=2.8->tensorflow) (2021.10.8)
Collecting urllib3<1.27,>=1.21.1
  Downloading https://mirrors.aliyun.com/pypi/packages/ec/03/062e6444ce4baf1eac17a6a0ebfe36bb1ad05e1df0e20b110de59c278498/urllib3-1.26.9-py2.py3-none-any.whl (138 kB)
     |████████████████████████████████| 138 kB 2.9 MB/s
Collecting idna<4,>=2.5
  Downloading https://mirrors.aliyun.com/pypi/packages/04/a2/d918dcd22354d8958fe113e1a3630137e0fc8b44859ade3063982eacd2a4/idna-3.3-py3-none-any.whl (61 kB)
     |████████████████████████████████| 61 kB 1.6 MB/s
Collecting oauthlib>=3.0.0
  Downloading https://mirrors.aliyun.com/pypi/packages/1d/46/5ee2475e1b46a26ca0fa10d3c1d479577fde6ee289f8c6aa6d7ec33e31fd/oauthlib-3.2.0-py3-none-any.whl (151 kB)
     |████████████████████████████████| 151 kB 1.8 MB/s
Building wheels for collected packages: termcolor
  Building wheel for termcolor (setup.py) ... done
  Created wheel for termcolor: filename=termcolor-1.1.0-py3-none-any.whl size=4848 sha256=3c5c5d90a9fff390e3d698146cc6ea624d2ff68fdf741d07a0b200ee3f1a39b7
  Stored in directory: /Users/yanghaoyuan/Library/Caches/pip/wheels/e2/ed/96/bab4f9f98bde3122e72958c854425c5ae975ebf7cefda75fd5
Successfully built termcolor
Installing collected packages: urllib3, pyasn1, idna, charset-normalizer, zipp, rsa, requests, pyasn1-modules, oauthlib, cachetools, requests-oauthlib, importlib-metadata, google-auth, werkzeug, tensorboard-plugin-wit, tensorboard-data-server, protobuf, markdown, grpcio, google-auth-oauthlib, absl-py, wrapt, typing-extensions, tf-estimator-nightly, termcolor, tensorflow-io-gcs-filesystem, tensorboard, opt-einsum, libclang, keras-preprocessing, keras, h5py, google-pasta, gast, flatbuffers, astunparse, tensorflow
Successfully installed absl-py-1.0.0 astunparse-1.6.3 cachetools-5.0.0 charset-normalizer-2.0.12 flatbuffers-2.0 gast-0.5.3 google-auth-2.6.2 google-auth-oauthlib-0.4.6 google-pasta-0.2.0 grpcio-1.45.0 h5py-3.6.0 idna-3.3 importlib-metadata-4.11.3 keras-2.8.0 keras-preprocessing-1.1.2 libclang-13.0.0 markdown-3.3.6 oauthlib-3.2.0 opt-einsum-3.3.0 protobuf-3.19.4 pyasn1-0.4.8 pyasn1-modules-0.2.8 requests-2.27.1 requests-oauthlib-1.3.1 rsa-4.8 tensorboard-2.8.0 tensorboard-data-server-0.6.1 tensorboard-plugin-wit-1.8.1 tensorflow-2.8.0 tensorflow-io-gcs-filesystem-0.24.0 termcolor-1.1.0 tf-estimator-nightly-2.8.0.dev2021122109 typing-extensions-4.1.1 urllib3-1.26.9 werkzeug-2.1.0 wrapt-1.14.0 zipp-3.7.0

用官方示例测试

测试1: 输出版本号 tf.__version__

$ python -c "import tensorflow as tf; print(tf.__version__)"
2.8.0

测试2: tf.reduce_sum(tf.random.normal([1000, 1000]))

$ python -c "import tensorflow as tf; print(tf.reduce_sum(tf.random.normal([1000, 1000])))"

$ python -c "import tensorflow as tf; print(tf.reduce_sum(tf.random.normal([1000, 1000])))"
2022-04-01 19:29:50.391309: I tensorflow/core/platform/cpu_feature_guard.cc:151] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX2 FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.

tf.Tensor(-499.786, shape=(), dtype=float32)

CPU架构指令集 AVX2 FMA 没有编译
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.

1. 安装bazel

$ brew install bazel

$ brew install bazel
Running brew update --preinstall...

==> Auto-updated Homebrew!

Updated 2 taps (homebrew/cask and homebrew/services).

==> Updated Casks
Updated 6 casks.

==> Downloading https://ghcr.io/v2/homebrew/core/openjdk/11/manifests/11.0.14.1

==> Downloading https://ghcr.io/v2/homebrew/core/openjdk/11/blobs/sha256:a409780e1dd4c23dc8c336235852dd7a4f099a1dae0faf76a2c03c1163a40f00
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:a409780e1dd4c23dc8c336235852dd7a4f099a1dae0faf76a2c03c1163a40f00?se=2022-04-01T12%3A20%3A00Z&sig=%2F8erY7hpcj6ukcrWILxG

==> Downloading https://ghcr.io/v2/homebrew/core/bazel/manifests/5.0.0

==> Downloading https://ghcr.io/v2/homebrew/core/bazel/blobs/sha256:66115decdbf36ffc74cd2d16ccd6e1006afcbd77db9616be557c566e2aeea3cd
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:66115decdbf36ffc74cd2d16ccd6e1006afcbd77db9616be557c566e2aeea3cd?se=2022-04-01T12%3A25%3A00Z&sig=xej%2BaZnP3VUUZEmj3kWi

==> Installing dependencies for bazel: openjdk@11
==> Installing bazel dependency: openjdk@11
==> Pouring openjdk@11--11.0.14.1.big_sur.bottle.tar.gz
🍺  /usr/local/Cellar/openjdk@11/11.0.14.1: 678 files, 298.2MB
==> Installing bazel
==> Pouring bazel--5.0.0.big_sur.bottle.tar.gz
==> Caveats
Bash completion has been installed to:
  /usr/local/etc/bash_completion.d
==> Summary
🍺  /usr/local/Cellar/bazel/5.0.0: 9 files, 33MB
==> brew cleanup has not been run in the last 30 days, running now...

Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.

Hide these hints with HOMEBREW_NO_ENV_HINTS (see man brew).

Pruned 0 symbolic links and 53 directories from /usr/local
==> Caveats
==> bazel
Bash completion has been installed to:
  /usr/local/etc/bash_completion.d
2. 安装 coreutils

$ pip install six numpy wheel

$ pip install six numpy wheel
Requirement already satisfied: six in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (1.16.0)
Requirement already satisfied: numpy in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (1.22.3)
Requirement already satisfied: wheel in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (0.37.1)

$ brew install coreutils

$ brew install coreutils
==> Downloading https://ghcr.io/v2/homebrew/core/gmp/manifests/6.2.1_1

==> Downloading https://ghcr.io/v2/homebrew/core/gmp/blobs/sha256:e566452815d2ff5dc66da160bd1cd3d9cf02a17a07284cf0bac46496133383ae
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:e566452815d2ff5dc66da160bd1cd3d9cf02a17a07284cf0bac46496133383ae?se=2022-04-01T12%3A35%3A00Z&sig=tgrzc6oOVbcNKVSPtPP5Dj

==> Downloading https://ghcr.io/v2/homebrew/core/coreutils/manifests/9.0_1

==> Downloading https://ghcr.io/v2/homebrew/core/coreutils/blobs/sha256:a5f2ae877c7b2d542e8156e5739a166652482f270dce0bc79cf5f85c4629d358
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:a5f2ae877c7b2d542e8156e5739a166652482f270dce0bc79cf5f85c4629d358?se=2022-04-01T12%3A35%3A00Z&sig=miwY3mqn8I5suFo2W5lbiy

==> Installing dependencies for coreutils: gmp
==> Installing coreutils dependency: gmp
==> Pouring gmp--6.2.1_1.big_sur.bottle.tar.gz
🍺  /usr/local/Cellar/gmp/6.2.1_1: 21 files, 3.3MB
==> Installing coreutils
==> Pouring coreutils--9.0_1.big_sur.bottle.tar.gz
==> Caveats
Commands also provided by macOS and the commands dir, dircolors, vdir have been installed with the prefix "g".

If you need to use these commands with their normal names, you can add a "gnubin" directory to your PATH with:
  PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
==> Summary
🍺  /usr/local/Cellar/coreutils/9.0_1: 480 files, 12.7MB
==> Running brew cleanup coreutils...

Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.

Hide these hints with HOMEBREW_NO_ENV_HINTS (see man brew).

==> Caveats
==> coreutils
Commands also provided by macOS and the commands dir, dircolors, vdir have been installed with the prefix "g".

If you need to use these commands with their normal names, you can add a "gnubin" directory to your PATH with:
  PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"

.bash_profile 添加下面的PATH并export PATH

PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"

3. 克隆 tensorflow

$ git clone https://github.com/tensorflow/tensorflow

git clone https://github.com/tensorflow/tensorflow
正克隆到 'tensorflow'...

4. 编译 tensorflow

$ ./configure

$ ./configure

// 编译支持 使用bazel 重新构建

cpu only
$ bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package
gpu support
bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package
5. 生成 whl文件 bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg

INFO: Analysed target //tensorflow/tools/pip_package:build_pip_package (0 packages loaded).

INFO: Found 1 target…

Target //tensorflow/tools/pip_package:build_pip_package up-to-date:
bazel-bin/tensorflow/tools/pip_package/build_pip_package
INFO: Elapsed time: 0.243s, Critical Path: 0.00s
INFO: Build completed successfully, 1 total action

bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
6. 安装
$ pip install /tmp/tensorflow_pkg/tensorflow-{version}-none-any.whl
7. 安装 jupyterlab

pip install jupyterlab

(TensorFlow2) yanghaoyuan@yanghaouandembp ~ % pip install jupyterlab
Collecting jupyterlab
  Downloading jupyterlab-3.4.5-py3-none-any.whl (8.8 MB)
     |████████████████████████████████| 8.8 MB 188 kB/s
Collecting nbclassic
  Downloading nbclassic-0.4.3-py3-none-any.whl (9.7 MB)
     |████████████████████████████████| 9.7 MB 20 kB/s
Requirement already satisfied: packaging in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from jupyterlab) (21.3)
Collecting jupyterlab-server~=2.10
  Downloading jupyterlab_server-2.15.0-py3-none-any.whl (54 kB)
     |████████████████████████████████| 54 kB 169 kB/s
Collecting jupyter-server~=1.16
  Downloading jupyter_server-1.18.1-py3-none-any.whl (344 kB)
     |████████████████████████████████| 344 kB 109 kB/s
Requirement already satisfied: jinja2>=2.1 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from jupyterlab) (3.1.1)
Requirement already satisfied: ipython in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from jupyterlab) (8.2.0)
Requirement already satisfied: tornado>=6.1.0 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from jupyterlab) (6.1)
Requirement already satisfied: jupyter-core in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from jupyterlab) (4.9.2)
Requirement already satisfied: notebook<7 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from jupyterlab) (6.4.10)
Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from jinja2>=2.1->jupyterlab) (2.1.1)
Collecting websocket-client
  Downloading websocket_client-1.3.3-py3-none-any.whl (54 kB)
     |████████████████████████████████| 54 kB 226 kB/s
Requirement already satisfied: jupyter-client>=6.1.12 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from jupyter-server~=1.16->jupyterlab) (7.2.1)
Requirement already satisfied: nbformat>=5.2.0 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from jupyter-server~=1.16->jupyterlab) (5.2.0)
Requirement already satisfied: argon2-cffi in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from jupyter-server~=1.16->jupyterlab) (21.3.0)
Requirement already satisfied: nbconvert>=6.4.4 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from jupyter-server~=1.16->jupyterlab) (6.4.5)
Requirement already satisfied: prometheus-client in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from jupyter-server~=1.16->jupyterlab) (0.13.1)
Requirement already satisfied: pyzmq>=17 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from jupyter-server~=1.16->jupyterlab) (22.3.0)
Requirement already satisfied: terminado>=0.8.3 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from jupyter-server~=1.16->jupyterlab) (0.13.3)
Requirement already satisfied: Send2Trash in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from jupyter-server~=1.16->jupyterlab) (1.8.0)
Requirement already satisfied: traitlets>=5.1 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from jupyter-server~=1.16->jupyterlab) (5.1.1)
Collecting anyio<4,>=3.1.0
  Downloading anyio-3.6.1-py3-none-any.whl (80 kB)
     |████████████████████████████████| 80 kB 216 kB/s
Collecting sniffio>=1.1
  Downloading sniffio-1.2.0-py3-none-any.whl (10 kB)
Requirement already satisfied: idna>=2.8 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from anyio<4,>=3.1.0->jupyter-server~=1.16->jupyterlab) (3.3)
Requirement already satisfied: python-dateutil>=2.8.2 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from jupyter-client>=6.1.12->jupyter-server~=1.16->jupyterlab) (2.8.2)
Requirement already satisfied: entrypoints in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from jupyter-client>=6.1.12->jupyter-server~=1.16->jupyterlab) (0.4)
Requirement already satisfied: nest-asyncio>=1.5.4 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from jupyter-client>=6.1.12->jupyter-server~=1.16->jupyterlab) (1.5.4)
Collecting json5
  Downloading json5-0.9.9-py2.py3-none-any.whl (18 kB)
Collecting babel
  Downloading Babel-2.10.3-py3-none-any.whl (9.5 MB)
     |████████████████████████████████| 9.5 MB 152 kB/s
Requirement already satisfied: requests in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from jupyterlab-server~=2.10->jupyterlab) (2.27.1)
Requirement already satisfied: jsonschema>=3.0.1 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from jupyterlab-server~=2.10->jupyterlab) (4.4.0)
Requirement already satisfied: importlib-metadata>=3.6 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from jupyterlab-server~=2.10->jupyterlab) (4.11.3)
Requirement already satisfied: zipp>=0.5 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from importlib-metadata>=3.6->jupyterlab-server~=2.10->jupyterlab) (3.7.0)
Requirement already satisfied: attrs>=17.4.0 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from jsonschema>=3.0.1->jupyterlab-server~=2.10->jupyterlab) (21.4.0)
Requirement already satisfied: pyrsistent!=0.17.0,!=0.17.1,!=0.17.2,>=0.14.0 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from jsonschema>=3.0.1->jupyterlab-server~=2.10->jupyterlab) (0.18.1)
Requirement already satisfied: nbclient<0.6.0,>=0.5.0 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from nbconvert>=6.4.4->jupyter-server~=1.16->jupyterlab) (0.5.13)
Requirement already satisfied: defusedxml in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from nbconvert>=6.4.4->jupyter-server~=1.16->jupyterlab) (0.7.1)
Requirement already satisfied: pandocfilters>=1.4.1 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from nbconvert>=6.4.4->jupyter-server~=1.16->jupyterlab) (1.5.0)
Requirement already satisfied: mistune<2,>=0.8.1 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from nbconvert>=6.4.4->jupyter-server~=1.16->jupyterlab) (0.8.4)
Requirement already satisfied: jupyterlab-pygments in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from nbconvert>=6.4.4->jupyter-server~=1.16->jupyterlab) (0.1.2)
Requirement already satisfied: beautifulsoup4 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from nbconvert>=6.4.4->jupyter-server~=1.16->jupyterlab) (4.10.0)
Requirement already satisfied: testpath in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from nbconvert>=6.4.4->jupyter-server~=1.16->jupyterlab) (0.6.0)
Requirement already satisfied: bleach in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from nbconvert>=6.4.4->jupyter-server~=1.16->jupyterlab) (4.1.0)
Requirement already satisfied: pygments>=2.4.1 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from nbconvert>=6.4.4->jupyter-server~=1.16->jupyterlab) (2.11.2)
Requirement already satisfied: ipykernel in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from notebook<7->jupyterlab) (6.11.0)
Requirement already satisfied: ipython-genutils in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from notebook<7->jupyterlab) (0.2.0)
Requirement already satisfied: six>=1.5 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from python-dateutil>=2.8.2->jupyter-client>=6.1.12->jupyter-server~=1.16->jupyterlab) (1.16.0)
Requirement already satisfied: ptyprocess in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from terminado>=0.8.3->jupyter-server~=1.16->jupyterlab) (0.7.0)
Requirement already satisfied: argon2-cffi-bindings in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from argon2-cffi->jupyter-server~=1.16->jupyterlab) (21.2.0)
Requirement already satisfied: cffi>=1.0.1 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from argon2-cffi-bindings->argon2-cffi->jupyter-server~=1.16->jupyterlab) (1.15.0)
Requirement already satisfied: pycparser in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from cffi>=1.0.1->argon2-cffi-bindings->argon2-cffi->jupyter-server~=1.16->jupyterlab) (2.21)
Collecting pytz>=2015.7
  Downloading pytz-2022.1-py2.py3-none-any.whl (503 kB)
     |████████████████████████████████| 503 kB 143 kB/s
Requirement already satisfied: soupsieve>1.2 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from beautifulsoup4->nbconvert>=6.4.4->jupyter-server~=1.16->jupyterlab) (2.3.1)
Requirement already satisfied: webencodings in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from bleach->nbconvert>=6.4.4->jupyter-server~=1.16->jupyterlab) (0.5.1)
Requirement already satisfied: setuptools>=60 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from ipykernel->notebook<7->jupyterlab) (61.3.0)
Requirement already satisfied: debugpy>=1.0 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from ipykernel->notebook<7->jupyterlab) (1.6.0)
Requirement already satisfied: matplotlib-inline>=0.1 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from ipykernel->notebook<7->jupyterlab) (0.1.3)
Requirement already satisfied: appnope in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from ipykernel->notebook<7->jupyterlab) (0.1.2)
Requirement already satisfied: psutil in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from ipykernel->notebook<7->jupyterlab) (5.9.0)
Requirement already satisfied: decorator in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from ipython->jupyterlab) (5.1.1)
Requirement already satisfied: prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from ipython->jupyterlab) (3.0.28)
Requirement already satisfied: pickleshare in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from ipython->jupyterlab) (0.7.5)
Requirement already satisfied: pexpect>4.3 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from ipython->jupyterlab) (4.8.0)
Requirement already satisfied: stack-data in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from ipython->jupyterlab) (0.2.0)
Requirement already satisfied: jedi>=0.16 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from ipython->jupyterlab) (0.18.1)
Requirement already satisfied: backcall in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from ipython->jupyterlab) (0.2.0)
Requirement already satisfied: parso<0.9.0,>=0.8.0 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from jedi>=0.16->ipython->jupyterlab) (0.8.3)
Requirement already satisfied: wcwidth in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0->ipython->jupyterlab) (0.2.5)
Collecting notebook-shim>=0.1.0
  Downloading notebook_shim-0.1.0-py3-none-any.whl (13 kB)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from packaging->jupyterlab) (3.0.7)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from requests->jupyterlab-server~=2.10->jupyterlab) (2021.10.8)
Requirement already satisfied: charset-normalizer~=2.0.0 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from requests->jupyterlab-server~=2.10->jupyterlab) (2.0.12)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from requests->jupyterlab-server~=2.10->jupyterlab) (1.26.9)
Requirement already satisfied: asttokens in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from stack-data->ipython->jupyterlab) (2.0.5)
Requirement already satisfied: executing in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from stack-data->ipython->jupyterlab) (0.8.3)
Requirement already satisfied: pure-eval in /usr/local/Caskroom/miniconda/base/envs/TensorFlow2/lib/python3.9/site-packages (from stack-data->ipython->jupyterlab) (0.2.2)
Installing collected packages: sniffio, websocket-client, anyio, pytz, jupyter-server, notebook-shim, json5, babel, nbclassic, jupyterlab-server, jupyterlab
Successfully installed anyio-3.6.1 babel-2.10.3 json5-0.9.9 jupyter-server-1.18.1 jupyterlab-3.4.5 jupyterlab-server-2.15.0 nbclassic-0.4.3 notebook-shim-0.1.0 pytz-2022.1 sniffio-1.2.0 websocket-client-1.3.3

启动 jupyter lab

jupyter lab

(TensorFlow2) yanghaoyuan@yanghaouandembp ~ % jupyter lab

MacOS 使用miniconda 虚拟环境 TensorFlow深度学习环境
下面测试一下
MacOS 使用miniconda 虚拟环境 TensorFlow深度学习环境
from tensorflow import keras
import numpy as np
model = keras.Sequential([keras.layers.Dense(units=1,input_shape=[1])])
model.compile(optimizer='sgd', loss='mean_squared_error')
xs=np.array([-1.0,0.0,1.0,2.0,3.0,4.0], dtype=float)
ys=np.array([-3.0,-1.0,1.0,3.0,5.0,7.0], dtype=float)
model.fit(xs,ys, epochs=500)

model.predict([10.0])

MacOS 使用miniconda 虚拟环境 TensorFlow深度学习环境
MacOS 使用miniconda 虚拟环境 TensorFlow深度学习环境

如果我们想删除本地的虚拟环境则按下面的操作

删除虚拟环境

$ conda deactivate
$ conda remove -n TensorFlow2 --all

$ conda deactivate
$ conda remove -n TensorFlow2 --all

Remove all packages in environment /usr/local/Caskroom/miniconda/base/envs/TensorFlow2:

  environment location: /usr/local/Caskroom/miniconda/base/envs/TensorFlow2

The following packages will be REMOVED:

  ca-certificates-2022.3.29-hecd8cb5_0
  certifi-2021.10.8-py39hecd8cb5_2
  libcxx-12.0.0-h2f01273_0
  libffi-3.3-hb1e8313_2
  ncurses-6.3-hca72f7f_2
  openssl-1.1.1n-hca72f7f_0
  pip-21.2.4-py39hecd8cb5_0
  python-3.9.11-hdfd78df_2
  readline-8.1.2-hca72f7f_1
  setuptools-58.0.4-py39hecd8cb5_0
  sqlite-3.38.2-h707629a_0
  tk-8.6.11-h7bc2e8c_0
  tzdata-2022a-hda174b7_0
  wheel-0.37.1-pyhd3eb1b0_0
  xz-5.2.5-h1de35cc_0
  zlib-1.2.11-h4dc903c_4

Proceed ([y]/n)? y

Preparing transaction: done
Verifying transaction: done
Executing transaction: done

Original: https://blog.csdn.net/faceqq/article/details/123891186
Author: yanghaoyuan.sh
Title: MacOS 使用miniconda 虚拟环境 TensorFlow深度学习环境

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/497458/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

亲爱的 Coder【最近整理,可免费获取】👉 最新必读书单  | 👏 面试题下载  | 🌎 免费的AI知识星球