conda command-line search and install a package in a new environment – tensorflow

Using conda from Anaconda is really easy to install complex environments even like TensorFlow on many different Linux distributions and Windows.
conda utility and its multiple environments guarantee no changes from the package system of the current Linux distribution. Installing operating system updates may break fine-tuned and complex development environments. Installing packages from conda minimizes the OS-related problems and offers the user to use of complex development setups in various Linux distributions like CentOS, Fedora, Manjdaro, Mint, Debian, Ubuntu, Elementary OS with the same command line interface.
Using pip instead of conda may lead to a broken environment after simple OS package updates.

STEP 1) Install conda command line utility.

The install is easy enough, just follow this article – Installing conda command line in various systems with miniconda and create a simple python environment
The conda command-line utility is installed by Miniconda3.

STEP 2) Search for conda packages.

Use the search command to find packages. All available versions are displayed supported for the current installation.

(base) myenv@srv ~ $ conda search tensorflow
Loading channels: done
# Name                       Version           Build  Channel             
tensorflow                     1.4.1               0  pkgs/main           
tensorflow                     1.5.0               0  pkgs/main           
tensorflow                     1.6.0               0  pkgs/main           
tensorflow                     1.7.0               0  pkgs/main           
tensorflow                     1.8.0               0  pkgs/main           
tensorflow                     1.8.0      h01c6a4e_0  pkgs/main           
tensorflow                     1.8.0      h06a4308_0  pkgs/main           
tensorflow                     1.8.0      h16da8f2_0  pkgs/main           
tensorflow                     1.8.0      h2742514_0  pkgs/main           
tensorflow                     1.8.0      h469b60b_0  pkgs/main           
tensorflow                     1.8.0      h57681fa_0  pkgs/main           
tensorflow                     1.8.0      h5c3c37f_0  pkgs/main           
tensorflow                     1.8.0      h645107b_0  pkgs/main           
tensorflow                     1.8.0      h7b2774c_0  pkgs/main           
tensorflow                     1.8.0      hb11d968_0  pkgs/main           
tensorflow                     1.8.0      hb1b1514_0  pkgs/main           
tensorflow                     1.8.0      hb381393_0  pkgs/main           
tensorflow                     1.8.0      hc2d9325_0  pkgs/main           
tensorflow                     1.9.0 eigen_py27hf386fcc_1  pkgs/main           
tensorflow                     1.9.0 eigen_py35h8c89287_1  pkgs/main           
tensorflow                     1.9.0 eigen_py36h8c89287_0  pkgs/main           
tensorflow                     1.9.0 eigen_py36hbec2359_0  pkgs/main           
tensorflow                     1.9.0 eigen_py36hbec2359_1  pkgs/main           
tensorflow                     1.9.0 eigen_py36hf386fcc_0  pkgs/main           
tensorflow                     1.9.0 gpu_py27h233f449_1  pkgs/main           
tensorflow                     1.9.0 gpu_py27h395d940_1  pkgs/main           
tensorflow                     1.9.0 gpu_py27hd3a791e_1  pkgs/main           
tensorflow                     1.9.0 gpu_py35h42d5ad8_1  pkgs/main           
tensorflow                     1.9.0 gpu_py35h60c0932_1  pkgs/main           
tensorflow                     1.9.0 gpu_py35hb39db67_1  pkgs/main           
tensorflow                     1.9.0 gpu_py36h02c5d5e_1  pkgs/main           
tensorflow                     1.9.0 gpu_py36h220e158_1  pkgs/main           
tensorflow                     1.9.0 gpu_py36h313df88_1  pkgs/main           
tensorflow                     1.9.0 mkl_py27h0cb61a4_1  pkgs/main           
tensorflow                     1.9.0 mkl_py35h5be851a_1  pkgs/main           
tensorflow                     1.9.0 mkl_py36h0cb61a4_0  pkgs/main           
tensorflow                     1.9.0 mkl_py36h5be851a_0  pkgs/main           
tensorflow                     1.9.0 mkl_py36h6d6ce78_0  pkgs/main           
tensorflow                     1.9.0 mkl_py36h6d6ce78_1  pkgs/main           
tensorflow                    1.10.0 eigen_py27ha0ab958_0  pkgs/main           
tensorflow                    1.10.0 eigen_py35h5ed898b_0  pkgs/main           
tensorflow                    1.10.0 eigen_py36hb995bb4_0  pkgs/main           
tensorflow                    1.10.0 gpu_py27h67ad7fe_0  pkgs/main           
tensorflow                    1.10.0 gpu_py27h6f941b3_0  pkgs/main           
tensorflow                    1.10.0 gpu_py27h9580370_0  pkgs/main           
tensorflow                    1.10.0 gpu_py35h566a776_0  pkgs/main           
tensorflow                    1.10.0 gpu_py35ha6119f3_0  pkgs/main           
tensorflow                    1.10.0 gpu_py35hd9c640d_0  pkgs/main           
tensorflow                    1.10.0 gpu_py36h8dbd23f_0  pkgs/main           
tensorflow                    1.10.0 gpu_py36h97a2126_0  pkgs/main           
tensorflow                    1.10.0 gpu_py36hcebf108_0  pkgs/main           
tensorflow                    1.10.0 mkl_py27h857755f_0  pkgs/main           
tensorflow                    1.10.0 mkl_py35heddcb22_0  pkgs/main           
tensorflow                    1.10.0 mkl_py36hdb377fd_0  pkgs/main           
tensorflow                    1.11.0 eigen_py27h06aee4b_0  pkgs/main           
tensorflow                    1.11.0 eigen_py36he3f7ef1_0  pkgs/main           
tensorflow                    1.11.0 gpu_py27h99ab47f_0  pkgs/main           
tensorflow                    1.11.0 gpu_py27hd8bfc1a_0  pkgs/main           
tensorflow                    1.11.0 gpu_py36h4459f94_0  pkgs/main           
tensorflow                    1.11.0 gpu_py36h9c9050a_0  pkgs/main           
tensorflow                    1.11.0 mkl_py27h25e0b76_0  pkgs/main           
tensorflow                    1.11.0 mkl_py36ha6f0bda_0  pkgs/main           
tensorflow                    1.12.0 eigen_py27hfe19c55_0  pkgs/main           
tensorflow                    1.12.0 eigen_py36hbd5f568_0  pkgs/main           
tensorflow                    1.12.0 gpu_py27h2a0f108_0  pkgs/main           
tensorflow                    1.12.0 gpu_py27h956c076_0  pkgs/main           
tensorflow                    1.12.0 gpu_py36he68c306_0  pkgs/main           
tensorflow                    1.12.0 gpu_py36he74679b_0  pkgs/main           
tensorflow                    1.12.0 mkl_py27hc55d17a_0  pkgs/main           
tensorflow                    1.12.0 mkl_py36h69b6ba0_0  pkgs/main           
tensorflow                    1.13.1 eigen_py27h5e92bea_0  pkgs/main           
tensorflow                    1.13.1 eigen_py36hc59b85e_0  pkgs/main           
tensorflow                    1.13.1 eigen_py37h7cb7401_0  pkgs/main           
tensorflow                    1.13.1 gpu_py27hc5faae7_0  pkgs/main           
tensorflow                    1.13.1 gpu_py27hcb41dfa_0  pkgs/main           
tensorflow                    1.13.1 gpu_py27hd3b962e_0  pkgs/main           
tensorflow                    1.13.1 gpu_py36h26cf82e_0  pkgs/main           
tensorflow                    1.13.1 gpu_py36h3991807_0  pkgs/main           
tensorflow                    1.13.1 gpu_py36h9b25d83_0  pkgs/main           
tensorflow                    1.13.1 gpu_py37h49933a4_0  pkgs/main           
tensorflow                    1.13.1 gpu_py37hc158e3b_0  pkgs/main           
tensorflow                    1.13.1 gpu_py37hd37c573_0  pkgs/main           
tensorflow                    1.13.1 mkl_py27h74ee40f_0  pkgs/main           
tensorflow                    1.13.1 mkl_py36h27d456a_0  pkgs/main           
tensorflow                    1.13.1 mkl_py37h54b294f_0  pkgs/main           
tensorflow                    1.14.0 eigen_py27h99c1539_0  pkgs/main           
tensorflow                    1.14.0 eigen_py36hb2cf719_0  pkgs/main           
tensorflow                    1.14.0 eigen_py37h195cb1b_0  pkgs/main           
tensorflow                    1.14.0 gpu_py27h39f1c70_0  pkgs/main           
tensorflow                    1.14.0 gpu_py27h48701d4_0  pkgs/main           
tensorflow                    1.14.0 gpu_py27h84ace93_0  pkgs/main           
tensorflow                    1.14.0 gpu_py27he9627f8_0  pkgs/main           
tensorflow                    1.14.0 gpu_py36h3fb9ad6_0  pkgs/main           
tensorflow                    1.14.0 gpu_py36h57aa796_0  pkgs/main           
tensorflow                    1.14.0 gpu_py36hc335bb8_0  pkgs/main           
tensorflow                    1.14.0 gpu_py36hfc5689a_0  pkgs/main           
tensorflow                    1.14.0 gpu_py37h4491b45_0  pkgs/main           
tensorflow                    1.14.0 gpu_py37h63f5f00_0  pkgs/main           
tensorflow                    1.14.0 gpu_py37h74c33d7_0  pkgs/main           
tensorflow                    1.14.0 gpu_py37hae64822_0  pkgs/main           
tensorflow                    1.14.0 mkl_py27h957988d_0  pkgs/main           
tensorflow                    1.14.0 mkl_py36h2526735_0  pkgs/main           
tensorflow                    1.14.0 mkl_py37h45c423b_0  pkgs/main           
tensorflow                    1.15.0 eigen_py27h7b7505e_0  pkgs/main           
tensorflow                    1.15.0 eigen_py36hd3854b5_0  pkgs/main           
tensorflow                    1.15.0 eigen_py37h3790f83_0  pkgs/main           
tensorflow                    1.15.0 gpu_py27h0c9f15b_0  pkgs/main           
tensorflow                    1.15.0 gpu_py36h5a509aa_0  pkgs/main           
tensorflow                    1.15.0 gpu_py37h0f0df58_0  pkgs/main           
tensorflow                    1.15.0 mkl_py27hbe5f72a_0  pkgs/main           
tensorflow                    1.15.0 mkl_py36h4920b83_0  pkgs/main           
tensorflow                    1.15.0 mkl_py37h28c19af_0  pkgs/main           
tensorflow                     2.0.0 eigen_py27hec4e49e_0  pkgs/main           
tensorflow                     2.0.0 eigen_py36ha83d16c_0  pkgs/main           
tensorflow                     2.0.0 eigen_py37hce6be7f_0  pkgs/main           
tensorflow                     2.0.0 gpu_py27hb041a2f_0  pkgs/main           
tensorflow                     2.0.0 gpu_py36h6b29c10_0  pkgs/main           
tensorflow                     2.0.0 gpu_py37h768510d_0  pkgs/main           
tensorflow                     2.0.0 mkl_py27h68eb67f_0  pkgs/main           
tensorflow                     2.0.0 mkl_py36hef7ec59_0  pkgs/main           
tensorflow                     2.0.0 mkl_py37h66b46cc_0  pkgs/main           
tensorflow                     2.1.0 eigen_py27h636cc2a_0  pkgs/main           
tensorflow                     2.1.0 eigen_py36hbb90eaf_0  pkgs/main           
tensorflow                     2.1.0 eigen_py37h1a52d58_0  pkgs/main           
tensorflow                     2.1.0 gpu_py27h9cdf9a9_0  pkgs/main           
tensorflow                     2.1.0 gpu_py36h2e5cdaa_0  pkgs/main           
tensorflow                     2.1.0 gpu_py37h7a4bb67_0  pkgs/main           
tensorflow                     2.1.0 mkl_py27h9dbd782_0  pkgs/main           
tensorflow                     2.1.0 mkl_py36h23468d9_0  pkgs/main           
tensorflow                     2.1.0 mkl_py37h80a91df_0  pkgs/main           
tensorflow                     2.2.0 eigen_py36h84d285f_0  pkgs/main           
tensorflow                     2.2.0 eigen_py37h1b16bb3_0  pkgs/main           
tensorflow                     2.2.0 eigen_py38hfc6e53c_0  pkgs/main           
tensorflow                     2.2.0 gpu_py36hf933387_0  pkgs/main           
tensorflow                     2.2.0 gpu_py37h1a511ff_0  pkgs/main           
tensorflow                     2.2.0 gpu_py38hb782248_0  pkgs/main           
tensorflow                     2.2.0 mkl_py36h5a57954_0  pkgs/main           
tensorflow                     2.2.0 mkl_py37h6e9ce2d_0  pkgs/main           
tensorflow                     2.2.0 mkl_py38h6d3daf0_0  pkgs/main           
tensorflow                     2.3.0 eigen_py37h189e6a2_0  pkgs/main           
tensorflow                     2.3.0 eigen_py38h71ff20e_0  pkgs/main           
tensorflow                     2.3.0 mkl_py37h0481017_0  pkgs/main           
tensorflow                     2.3.0 mkl_py38hd53216f_0  pkgs/main           
tensorflow                     2.4.1 eigen_py37h3da6045_0  pkgs/main           
tensorflow                     2.4.1 eigen_py38h0e0807f_0  pkgs/main           
tensorflow                     2.4.1 eigen_py39h813c054_0  pkgs/main           
tensorflow                     2.4.1 gpu_py37ha2e99fa_0  pkgs/main           
tensorflow                     2.4.1 gpu_py38h8a7d6ce_0  pkgs/main           
tensorflow                     2.4.1 gpu_py39h8236f22_0  pkgs/main           
tensorflow                     2.4.1 mkl_py37h2d14ff2_0  pkgs/main           
tensorflow                     2.4.1 mkl_py38hb2083e0_0  pkgs/main           
tensorflow                     2.4.1 mkl_py39h4683426_0  pkgs/main           
tensorflow                     2.5.0 eigen_py37hff93566_0  pkgs/main           
tensorflow                     2.5.0 eigen_py38h17aada3_0  pkgs/main           
tensorflow                     2.5.0 eigen_py38h94feaef_0  pkgs/main           
tensorflow                     2.5.0 eigen_py39hd8d7d70_0  pkgs/main           
tensorflow                     2.5.0 mkl_py37h3e8b3f4_0  pkgs/main           
tensorflow                     2.5.0 mkl_py38hce4fbe1_0  pkgs/main           
tensorflow                     2.5.0 mkl_py39h4a0693c_0  pkgs/main           
tensorflow                     2.6.0 eigen_py37h34b007a_0  pkgs/main           
tensorflow                     2.6.0 eigen_py38hcc1cb13_0  pkgs/main           
tensorflow                     2.6.0 eigen_py39h4b72145_0  pkgs/main           
tensorflow                     2.6.0 mkl_py37h9d15365_0  pkgs/main           
tensorflow                     2.6.0 mkl_py38h874c8e8_0  pkgs/main           
tensorflow                     2.6.0 mkl_py39haac40d1_0  pkgs/main

Apparently, the latest version of TensorFlow is 2.6.0:

(base) myenv@srv ~ $ conda search tensorflow=2.6.0                   
Loading channels: done
# Name                       Version           Build  Channel             
tensorflow                     2.6.0 eigen_py37h34b007a_0  pkgs/main           
tensorflow                     2.6.0 eigen_py38hcc1cb13_0  pkgs/main           
tensorflow                     2.6.0 eigen_py39h4b72145_0  pkgs/main           
tensorflow                     2.6.0 mkl_py37h9d15365_0  pkgs/main           
tensorflow                     2.6.0 mkl_py38h874c8e8_0  pkgs/main           
tensorflow                     2.6.0 mkl_py39haac40d1_0  pkgs/main

If the user needs GPU accelerated version of TensorFlow, an older version should be used such as 2.4.1.

STEP 3) Install TensorFlow package.

Installing the tensorflow CPU accelerated package in a new environment (mytensorflow26):

(base) myenv@srv ~ $ conda create --name mytensorflow26 tensorflow=2.6.0=mkl_py39haac40d1_0
Collecting package metadata (current_repodata.json): done
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /home/myenv/miniconda3/envs/mytensorflow26

  added / updated specs:
    - tensorflow==2.6.0=mkl_py39haac40d1_0


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    abseil-cpp-20210324.2      |       h2531618_0         965 KB
    absl-py-0.15.0             |     pyhd3eb1b0_0         103 KB
    aiohttp-3.8.1              |   py39h7f8727e_0         516 KB
    aiosignal-1.2.0            |     pyhd3eb1b0_0          12 KB
    astor-0.8.1                |   py39h06a4308_0          47 KB
    astunparse-1.6.3           |             py_0          17 KB
    async-timeout-4.0.1        |     pyhd3eb1b0_0          10 KB
    attrs-21.4.0               |     pyhd3eb1b0_0          51 KB
    blas-1.0                   |              mkl           6 KB
    blinker-1.4                |   py39h06a4308_0          23 KB
    c-ares-1.18.1              |       h7f8727e_0         114 KB
    cachetools-4.2.2           |     pyhd3eb1b0_0          13 KB
    click-8.0.3                |     pyhd3eb1b0_0          79 KB
    dataclasses-0.8            |     pyh6d0b6a4_7           8 KB
    flatbuffers-2.0.0          |       h2531618_0         975 KB
    frozenlist-1.2.0           |   py39h7f8727e_0          79 KB
    gast-0.4.0                 |     pyhd3eb1b0_0          13 KB
    giflib-5.2.1               |       h7b6447c_0          78 KB
    google-auth-1.33.0         |     pyhd3eb1b0_0          80 KB
    google-auth-oauthlib-0.4.1 |             py_2          20 KB
    google-pasta-0.2.0         |     pyhd3eb1b0_0          46 KB
    grpcio-1.42.0              |   py39hce63b2e_0         2.1 MB
    h5py-3.6.0                 |   py39ha0f2276_0         1.1 MB
    hdf5-1.10.6                |       hb1b8bf9_0         3.7 MB
    icu-68.1                   |       h2531618_0        11.8 MB
    importlib-metadata-4.8.2   |   py39h06a4308_0          39 KB
    intel-openmp-2021.4.0      |    h06a4308_3561         4.2 MB
    jpeg-9d                    |       h7f8727e_0         232 KB
    keras-preprocessing-1.1.2  |     pyhd3eb1b0_0          35 KB
    krb5-1.19.2                |       hac12032_0         1.2 MB
    libcurl-7.80.0             |       h0b77cf5_0         339 KB
    libedit-3.1.20210910       |       h7f8727e_0         166 KB
    libev-4.33                 |       h7f8727e_1         111 KB
    libgfortran-ng-7.5.0       |      ha8ba4b0_17          22 KB
    libgfortran4-7.5.0         |      ha8ba4b0_17         995 KB
    libnghttp2-1.46.0          |       hce63b2e_0         680 KB
    libpng-1.6.37              |       hbc83047_0         278 KB
    libprotobuf-3.14.0         |       h8c45485_0         2.0 MB
    libssh2-1.9.0              |       h1ba5d50_1         269 KB
    markdown-3.3.4             |   py39h06a4308_0         129 KB
    mkl-2021.4.0               |     h06a4308_640       142.6 MB
    mkl-service-2.4.0          |   py39h7f8727e_0          59 KB
    mkl_fft-1.3.1              |   py39hd3c417c_0         182 KB
    mkl_random-1.2.2           |   py39h51133e4_0         309 KB
    multidict-5.2.0            |   py39h7f8727e_2          64 KB
    numpy-1.21.2               |   py39h20f2e39_0          23 KB
    numpy-base-1.21.2          |   py39h79a1101_0         4.9 MB
    oauthlib-3.1.1             |     pyhd3eb1b0_0          90 KB
    opt_einsum-3.3.0           |     pyhd3eb1b0_1          57 KB
    protobuf-3.14.0            |   py39h2531618_1         306 KB
    pyasn1-0.4.8               |     pyhd3eb1b0_0          54 KB
    pyasn1-modules-0.2.8       |             py_0          72 KB
    pyjwt-2.1.0                |   py39h06a4308_0          32 KB
    python-flatbuffers-1.12    |     pyhd3eb1b0_0          24 KB
    requests-oauthlib-1.3.0    |             py_0          23 KB
    rsa-4.7.2                  |     pyhd3eb1b0_1          28 KB
    scipy-1.7.3                |   py39hc147768_0        16.9 MB
    snappy-1.1.8               |       he6710b0_0          40 KB
    tensorboard-2.6.0          |             py_1         4.9 MB
    tensorboard-data-server-0.6.0|   py39hca6d32c_0         2.7 MB
    tensorboard-plugin-wit-1.6.0|             py_0         630 KB
    tensorflow-2.6.0           |mkl_py39haac40d1_0           4 KB
    tensorflow-base-2.6.0      |mkl_py39h3d85931_0        76.7 MB
    tensorflow-estimator-2.6.0 |     pyh7b7c402_0         267 KB
    termcolor-1.1.0            |   py39h06a4308_1           9 KB
    typing-extensions-3.10.0.2 |       hd3eb1b0_0          12 KB
    typing_extensions-3.10.0.2 |     pyh06a4308_0          31 KB
    urllib3-1.26.8             |     pyhd3eb1b0_0         106 KB
    werkzeug-2.0.2             |     pyhd3eb1b0_0         224 KB
    wheel-0.35.1               |     pyhd3eb1b0_0          38 KB
    wrapt-1.13.3               |   py39h7f8727e_2          52 KB
    yarl-1.6.3                 |   py39h27cfd23_0         136 KB
    zipp-3.7.0                 |     pyhd3eb1b0_0          12 KB
    ------------------------------------------------------------
                                           Total:       283.9 MB

The following NEW packages will be INSTALLED:

  _libgcc_mutex      pkgs/main/linux-64::_libgcc_mutex-0.1-main
  _openmp_mutex      pkgs/main/linux-64::_openmp_mutex-4.5-1_gnu
  _tflow_select      pkgs/main/linux-64::_tflow_select-2.3.0-mkl
  abseil-cpp         pkgs/main/linux-64::abseil-cpp-20210324.2-h2531618_0
  absl-py            pkgs/main/noarch::absl-py-0.15.0-pyhd3eb1b0_0
  aiohttp            pkgs/main/linux-64::aiohttp-3.8.1-py39h7f8727e_0
  aiosignal          pkgs/main/noarch::aiosignal-1.2.0-pyhd3eb1b0_0
  astor              pkgs/main/linux-64::astor-0.8.1-py39h06a4308_0
  astunparse         pkgs/main/noarch::astunparse-1.6.3-py_0
  async-timeout      pkgs/main/noarch::async-timeout-4.0.1-pyhd3eb1b0_0
  attrs              pkgs/main/noarch::attrs-21.4.0-pyhd3eb1b0_0
  blas               pkgs/main/linux-64::blas-1.0-mkl
  blinker            pkgs/main/linux-64::blinker-1.4-py39h06a4308_0
  brotlipy           pkgs/main/linux-64::brotlipy-0.7.0-py39h27cfd23_1003
  c-ares             pkgs/main/linux-64::c-ares-1.18.1-h7f8727e_0
  ca-certificates    pkgs/main/linux-64::ca-certificates-2021.10.26-h06a4308_2
  cachetools         pkgs/main/noarch::cachetools-4.2.2-pyhd3eb1b0_0
  certifi            pkgs/main/linux-64::certifi-2021.10.8-py39h06a4308_2
  cffi               pkgs/main/linux-64::cffi-1.15.0-py39hd667e15_1
  charset-normalizer pkgs/main/noarch::charset-normalizer-2.0.4-pyhd3eb1b0_0
  click              pkgs/main/noarch::click-8.0.3-pyhd3eb1b0_0
  cryptography       pkgs/main/linux-64::cryptography-3.4.8-py39hd23ed53_0
  dataclasses        pkgs/main/noarch::dataclasses-0.8-pyh6d0b6a4_7
  flatbuffers        pkgs/main/linux-64::flatbuffers-2.0.0-h2531618_0
  frozenlist         pkgs/main/linux-64::frozenlist-1.2.0-py39h7f8727e_0
  gast               pkgs/main/noarch::gast-0.4.0-pyhd3eb1b0_0
  giflib             pkgs/main/linux-64::giflib-5.2.1-h7b6447c_0
  google-auth        pkgs/main/noarch::google-auth-1.33.0-pyhd3eb1b0_0
  google-auth-oauth~ pkgs/main/noarch::google-auth-oauthlib-0.4.1-py_2
  google-pasta       pkgs/main/noarch::google-pasta-0.2.0-pyhd3eb1b0_0
  grpcio             pkgs/main/linux-64::grpcio-1.42.0-py39hce63b2e_0
  h5py               pkgs/main/linux-64::h5py-3.6.0-py39ha0f2276_0
  hdf5               pkgs/main/linux-64::hdf5-1.10.6-hb1b8bf9_0
  icu                pkgs/main/linux-64::icu-68.1-h2531618_0
  idna               pkgs/main/noarch::idna-3.3-pyhd3eb1b0_0
  importlib-metadata pkgs/main/linux-64::importlib-metadata-4.8.2-py39h06a4308_0
  intel-openmp       pkgs/main/linux-64::intel-openmp-2021.4.0-h06a4308_3561
  jpeg               pkgs/main/linux-64::jpeg-9d-h7f8727e_0
  keras-preprocessi~ pkgs/main/noarch::keras-preprocessing-1.1.2-pyhd3eb1b0_0
  krb5               pkgs/main/linux-64::krb5-1.19.2-hac12032_0
  ld_impl_linux-64   pkgs/main/linux-64::ld_impl_linux-64-2.35.1-h7274673_9
  libcurl            pkgs/main/linux-64::libcurl-7.80.0-h0b77cf5_0
  libedit            pkgs/main/linux-64::libedit-3.1.20210910-h7f8727e_0
  libev              pkgs/main/linux-64::libev-4.33-h7f8727e_1
  libffi             pkgs/main/linux-64::libffi-3.3-he6710b0_2
  libgcc-ng          pkgs/main/linux-64::libgcc-ng-9.3.0-h5101ec6_17
  libgfortran-ng     pkgs/main/linux-64::libgfortran-ng-7.5.0-ha8ba4b0_17
  libgfortran4       pkgs/main/linux-64::libgfortran4-7.5.0-ha8ba4b0_17
  libgomp            pkgs/main/linux-64::libgomp-9.3.0-h5101ec6_17
  libnghttp2         pkgs/main/linux-64::libnghttp2-1.46.0-hce63b2e_0
  libpng             pkgs/main/linux-64::libpng-1.6.37-hbc83047_0
  libprotobuf        pkgs/main/linux-64::libprotobuf-3.14.0-h8c45485_0
  libssh2            pkgs/main/linux-64::libssh2-1.9.0-h1ba5d50_1
  libstdcxx-ng       pkgs/main/linux-64::libstdcxx-ng-9.3.0-hd4cf53a_17
  markdown           pkgs/main/linux-64::markdown-3.3.4-py39h06a4308_0
  mkl                pkgs/main/linux-64::mkl-2021.4.0-h06a4308_640
  mkl-service        pkgs/main/linux-64::mkl-service-2.4.0-py39h7f8727e_0
  mkl_fft            pkgs/main/linux-64::mkl_fft-1.3.1-py39hd3c417c_0
  mkl_random         pkgs/main/linux-64::mkl_random-1.2.2-py39h51133e4_0
  multidict          pkgs/main/linux-64::multidict-5.2.0-py39h7f8727e_2
  ncurses            pkgs/main/linux-64::ncurses-6.3-h7f8727e_2
  numpy              pkgs/main/linux-64::numpy-1.21.2-py39h20f2e39_0
  numpy-base         pkgs/main/linux-64::numpy-base-1.21.2-py39h79a1101_0
  oauthlib           pkgs/main/noarch::oauthlib-3.1.1-pyhd3eb1b0_0
  openssl            pkgs/main/linux-64::openssl-1.1.1m-h7f8727e_0
  opt_einsum         pkgs/main/noarch::opt_einsum-3.3.0-pyhd3eb1b0_1
  pip                pkgs/main/linux-64::pip-21.2.4-py39h06a4308_0
  protobuf           pkgs/main/linux-64::protobuf-3.14.0-py39h2531618_1
  pyasn1             pkgs/main/noarch::pyasn1-0.4.8-pyhd3eb1b0_0
  pyasn1-modules     pkgs/main/noarch::pyasn1-modules-0.2.8-py_0
  pycparser          pkgs/main/noarch::pycparser-2.21-pyhd3eb1b0_0
  pyjwt              pkgs/main/linux-64::pyjwt-2.1.0-py39h06a4308_0
  pyopenssl          pkgs/main/noarch::pyopenssl-21.0.0-pyhd3eb1b0_1
  pysocks            pkgs/main/linux-64::pysocks-1.7.1-py39h06a4308_0
  python             pkgs/main/linux-64::python-3.9.7-h12debd9_1
  python-flatbuffers pkgs/main/noarch::python-flatbuffers-1.12-pyhd3eb1b0_0
  readline           pkgs/main/linux-64::readline-8.1.2-h7f8727e_1
  requests           pkgs/main/noarch::requests-2.27.1-pyhd3eb1b0_0
  requests-oauthlib  pkgs/main/noarch::requests-oauthlib-1.3.0-py_0
  rsa                pkgs/main/noarch::rsa-4.7.2-pyhd3eb1b0_1
  scipy              pkgs/main/linux-64::scipy-1.7.3-py39hc147768_0
  setuptools         pkgs/main/linux-64::setuptools-58.0.4-py39h06a4308_0
  six                pkgs/main/noarch::six-1.16.0-pyhd3eb1b0_0
  snappy             pkgs/main/linux-64::snappy-1.1.8-he6710b0_0
  sqlite             pkgs/main/linux-64::sqlite-3.37.0-hc218d9a_0
  tensorboard        pkgs/main/noarch::tensorboard-2.6.0-py_1
  tensorboard-data-~ pkgs/main/linux-64::tensorboard-data-server-0.6.0-py39hca6d32c_0
  tensorboard-plugi~ pkgs/main/noarch::tensorboard-plugin-wit-1.6.0-py_0
  tensorflow         pkgs/main/linux-64::tensorflow-2.6.0-mkl_py39haac40d1_0
  tensorflow-base    pkgs/main/linux-64::tensorflow-base-2.6.0-mkl_py39h3d85931_0
  tensorflow-estima~ pkgs/main/noarch::tensorflow-estimator-2.6.0-pyh7b7c402_0
  termcolor          pkgs/main/linux-64::termcolor-1.1.0-py39h06a4308_1
  tk                 pkgs/main/linux-64::tk-8.6.11-h1ccaba5_0
  typing-extensions  pkgs/main/noarch::typing-extensions-3.10.0.2-hd3eb1b0_0
  typing_extensions  pkgs/main/noarch::typing_extensions-3.10.0.2-pyh06a4308_0
  tzdata             pkgs/main/noarch::tzdata-2021e-hda174b7_0
  urllib3            pkgs/main/noarch::urllib3-1.26.8-pyhd3eb1b0_0
  werkzeug           pkgs/main/noarch::werkzeug-2.0.2-pyhd3eb1b0_0
  wheel              pkgs/main/noarch::wheel-0.35.1-pyhd3eb1b0_0
  wrapt              pkgs/main/linux-64::wrapt-1.13.3-py39h7f8727e_2
  xz                 pkgs/main/linux-64::xz-5.2.5-h7b6447c_0
  yarl               pkgs/main/linux-64::yarl-1.6.3-py39h27cfd23_0
  zipp               pkgs/main/noarch::zipp-3.7.0-pyhd3eb1b0_0
  zlib               pkgs/main/linux-64::zlib-1.2.11-h7f8727e_4


Proceed ([y]/n)? y


Downloading and Extracting Packages
libpng-1.6.37        | 278 KB    | ################################################################### | 100% 
frozenlist-1.2.0     | 79 KB     | ################################################################### | 100% 
mkl_random-1.2.2     | 309 KB    | ################################################################### | 100% 
h5py-3.6.0           | 1.1 MB    | ################################################################### | 100% 
absl-py-0.15.0       | 103 KB    | ################################################################### | 100% 
mkl-service-2.4.0    | 59 KB     | ################################################################### | 100% 
astor-0.8.1          | 47 KB     | ################################################################### | 100% 
numpy-base-1.21.2    | 4.9 MB    | ################################################################### | 100% 
jpeg-9d              | 232 KB    | ################################################################### | 100% 
giflib-5.2.1         | 78 KB     | ################################################################### | 100% 
tensorboard-data-ser | 2.7 MB    | ################################################################### | 100% 
libnghttp2-1.46.0    | 680 KB    | ################################################################### | 100% 
importlib-metadata-4 | 39 KB     | ################################################################### | 100% 
krb5-1.19.2          | 1.2 MB    | ################################################################### | 100% 
hdf5-1.10.6          | 3.7 MB    | ################################################################### | 100% 
pyasn1-modules-0.2.8 | 72 KB     | ################################################################### | 100% 
typing-extensions-3. | 12 KB     | ################################################################### | 100% 
google-pasta-0.2.0   | 46 KB     | ################################################################### | 100% 
numpy-1.21.2         | 23 KB     | ################################################################### | 100% 
wrapt-1.13.3         | 52 KB     | ################################################################### | 100% 
tensorboard-plugin-w | 630 KB    | ################################################################### | 100% 
opt_einsum-3.3.0     | 57 KB     | ################################################################### | 100% 
libgfortran-ng-7.5.0 | 22 KB     | ################################################################### | 100% 
pyjwt-2.1.0          | 32 KB     | ################################################################### | 100% 
werkzeug-2.0.2       | 224 KB    | ################################################################### | 100% 
intel-openmp-2021.4. | 4.2 MB    | ################################################################### | 100% 
grpcio-1.42.0        | 2.1 MB    | ################################################################### | 100% 
icu-68.1             | 11.8 MB   | ################################################################### | 100% 
c-ares-1.18.1        | 114 KB    | ################################################################### | 100% 
keras-preprocessing- | 35 KB     | ################################################################### | 100% 
google-auth-1.33.0   | 80 KB     | ################################################################### | 100% 
tensorboard-2.6.0    | 4.9 MB    | ################################################################### | 100% 
blinker-1.4          | 23 KB     | ################################################################### | 100% 
blas-1.0             | 6 KB      | ################################################################### | 100% 
cachetools-4.2.2     | 13 KB     | ################################################################### | 100% 
abseil-cpp-20210324. | 965 KB    | ################################################################### | 100% 
mkl-2021.4.0         | 142.6 MB  | ################################################################### | 100% 
tensorflow-2.6.0     | 4 KB      | ################################################################### | 100% 
astunparse-1.6.3     | 17 KB     | ################################################################### | 100% 
typing_extensions-3. | 31 KB     | ################################################################### | 100% 
requests-oauthlib-1. | 23 KB     | ################################################################### | 100% 
snappy-1.1.8         | 40 KB     | ################################################################### | 100% 
tensorflow-estimator | 267 KB    | ################################################################### | 100% 
aiohttp-3.8.1        | 516 KB    | ################################################################### | 100% 
flatbuffers-2.0.0    | 975 KB    | ################################################################### | 100% 
yarl-1.6.3           | 136 KB    | ################################################################### | 100% 
gast-0.4.0           | 13 KB     | ################################################################### | 100% 
python-flatbuffers-1 | 24 KB     | ################################################################### | 100% 
libcurl-7.80.0       | 339 KB    | ################################################################### | 100% 
wheel-0.35.1         | 38 KB     | ################################################################### | 100% 
google-auth-oauthlib | 20 KB     | ################################################################### | 100% 
scipy-1.7.3          | 16.9 MB   | ################################################################### | 100% 
tensorflow-base-2.6. | 76.7 MB   | ################################################################### | 100% 
zipp-3.7.0           | 12 KB     | ################################################################### | 100% 
dataclasses-0.8      | 8 KB      | ################################################################### | 100% 
libedit-3.1.20210910 | 166 KB    | ################################################################### | 100% 
termcolor-1.1.0      | 9 KB      | ################################################################### | 100% 
async-timeout-4.0.1  | 10 KB     | ################################################################### | 100% 
mkl_fft-1.3.1        | 182 KB    | ################################################################### | 100% 
rsa-4.7.2            | 28 KB     | ################################################################### | 100% 
libssh2-1.9.0        | 269 KB    | ################################################################### | 100% 
libgfortran4-7.5.0   | 995 KB    | ################################################################### | 100% 
libprotobuf-3.14.0   | 2.0 MB    | ################################################################### | 100% 
urllib3-1.26.8       | 106 KB    | ################################################################### | 100% 
aiosignal-1.2.0      | 12 KB     | ################################################################### | 100% 
click-8.0.3          | 79 KB     | ################################################################### | 100% 
markdown-3.3.4       | 129 KB    | ################################################################### | 100% 
multidict-5.2.0      | 64 KB     | ################################################################### | 100% 
protobuf-3.14.0      | 306 KB    | ################################################################### | 100% 
libev-4.33           | 111 KB    | ################################################################### | 100% 
attrs-21.4.0         | 51 KB     | ################################################################### | 100% 
pyasn1-0.4.8         | 54 KB     | ################################################################### | 100% 
oauthlib-3.1.1       | 90 KB     | ################################################################### | 100% 
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
#     $ conda activate mytensorflow26
#
# To deactivate an active environment, use
#
#     $ conda deactivate

Now to check if the TensorFlow is installed and works correctly. First, activate the TensorFlow environment and test the library:

(base) myenv@srv ~ $ conda activate mytensorflow26
(mytensorflow26) myenv@srv ~ $ python -c "import tensorflow as tf;print(tf.reduce_sum(tf.random.normal([1000, 1000])))"
2022-02-01 07:15:37.648023: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  SSE4.1 SSE4.2 AVX AVX2 FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2022-02-01 07:15:37.649597: I tensorflow/core/common_runtime/process_util.cc:146] Creating new thread pool with default inter op setting: 2. Tune using inter_op_parallelism_threads for best performance.
tf.Tensor(-306.92828, shape=(), dtype=float32)
(mytensorflow26) myenv@srv ~ $

It works perfectly.

In the base environment there is no such Python module:

(mytensorflow26) myenv@srv ~ $ conda deactivate
(base) myenv@srv ~ $ python -c "import tensorflow as tf;print(tf.reduce_sum(tf.random.normal([1000, 1000])))"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'tensorflow'

To install a package (TensorFlow, for example) in an existing environment the “conda install” command would be used.
First, create the environment with “conda create”.

(base) myenv@srv ~ $ conda create --name mytensorflow25 python=3.9
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /home/myenv/miniconda3/envs/mytensorflow25

  added / updated specs:
    - python=3.9


The following NEW packages will be INSTALLED:

  _libgcc_mutex      pkgs/main/linux-64::_libgcc_mutex-0.1-main
  _openmp_mutex      pkgs/main/linux-64::_openmp_mutex-4.5-1_gnu
  ca-certificates    pkgs/main/linux-64::ca-certificates-2021.10.26-h06a4308_2
  certifi            pkgs/main/linux-64::certifi-2021.10.8-py39h06a4308_2
  ld_impl_linux-64   pkgs/main/linux-64::ld_impl_linux-64-2.35.1-h7274673_9
  libffi             pkgs/main/linux-64::libffi-3.3-he6710b0_2
  libgcc-ng          pkgs/main/linux-64::libgcc-ng-9.3.0-h5101ec6_17
  libgomp            pkgs/main/linux-64::libgomp-9.3.0-h5101ec6_17
  libstdcxx-ng       pkgs/main/linux-64::libstdcxx-ng-9.3.0-hd4cf53a_17
  ncurses            pkgs/main/linux-64::ncurses-6.3-h7f8727e_2
  openssl            pkgs/main/linux-64::openssl-1.1.1m-h7f8727e_0
  pip                pkgs/main/linux-64::pip-21.2.4-py39h06a4308_0
  python             pkgs/main/linux-64::python-3.9.7-h12debd9_1
  readline           pkgs/main/linux-64::readline-8.1.2-h7f8727e_1
  setuptools         pkgs/main/linux-64::setuptools-58.0.4-py39h06a4308_0
  sqlite             pkgs/main/linux-64::sqlite-3.37.0-hc218d9a_0
  tk                 pkgs/main/linux-64::tk-8.6.11-h1ccaba5_0
  tzdata             pkgs/main/noarch::tzdata-2021e-hda174b7_0
  wheel              pkgs/main/noarch::wheel-0.37.1-pyhd3eb1b0_0
  xz                 pkgs/main/linux-64::xz-5.2.5-h7b6447c_0
  zlib               pkgs/main/linux-64::zlib-1.2.11-h7f8727e_4


Proceed ([y]/n)? y

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

(base) 

Install the TensorFlow 2.5.0 CPU accelerated package and test the environment:

(base) myenv@srv ~ $ conda activate mytensorflow25
(mytensorflow25) myenv@srv ~ $ conda install tensorflow=2.5.0=mkl*
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /home/myenv/miniconda3/envs/mytensorflow25

  added / updated specs:
    - tensorflow==2.5.0[build=mkl*]


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    abseil-cpp-20200923.3      |       h2531618_0         919 KB
    tensorboard-2.5.0          |             py_0         5.3 MB
    tensorflow-2.5.0           |mkl_py39h4a0693c_0           4 KB
    tensorflow-base-2.5.0      |mkl_py39h35b2a3d_0        75.4 MB
    tensorflow-estimator-2.5.0 |     pyh7b7c402_0         267 KB
    ------------------------------------------------------------
                                           Total:        81.9 MB

The following NEW packages will be INSTALLED:

  _tflow_select      pkgs/main/linux-64::_tflow_select-2.3.0-mkl
  abseil-cpp         pkgs/main/linux-64::abseil-cpp-20200923.3-h2531618_0
  absl-py            pkgs/main/noarch::absl-py-0.15.0-pyhd3eb1b0_0
  aiohttp            pkgs/main/linux-64::aiohttp-3.8.1-py39h7f8727e_0
  aiosignal          pkgs/main/noarch::aiosignal-1.2.0-pyhd3eb1b0_0
  astor              pkgs/main/linux-64::astor-0.8.1-py39h06a4308_0
  astunparse         pkgs/main/noarch::astunparse-1.6.3-py_0
  async-timeout      pkgs/main/noarch::async-timeout-4.0.1-pyhd3eb1b0_0
  attrs              pkgs/main/noarch::attrs-21.4.0-pyhd3eb1b0_0
  blas               pkgs/main/linux-64::blas-1.0-mkl
  blinker            pkgs/main/linux-64::blinker-1.4-py39h06a4308_0
  brotlipy           pkgs/main/linux-64::brotlipy-0.7.0-py39h27cfd23_1003
  c-ares             pkgs/main/linux-64::c-ares-1.18.1-h7f8727e_0
  cachetools         pkgs/main/noarch::cachetools-4.2.2-pyhd3eb1b0_0
  cffi               pkgs/main/linux-64::cffi-1.15.0-py39hd667e15_1
  charset-normalizer pkgs/main/noarch::charset-normalizer-2.0.4-pyhd3eb1b0_0
  click              pkgs/main/noarch::click-8.0.3-pyhd3eb1b0_0
  cryptography       pkgs/main/linux-64::cryptography-3.4.8-py39hd23ed53_0
  dataclasses        pkgs/main/noarch::dataclasses-0.8-pyh6d0b6a4_7
  flatbuffers        pkgs/main/linux-64::flatbuffers-2.0.0-h2531618_0
  frozenlist         pkgs/main/linux-64::frozenlist-1.2.0-py39h7f8727e_0
  gast               pkgs/main/noarch::gast-0.4.0-pyhd3eb1b0_0
  giflib             pkgs/main/linux-64::giflib-5.2.1-h7b6447c_0
  google-auth        pkgs/main/noarch::google-auth-1.33.0-pyhd3eb1b0_0
  google-auth-oauth~ pkgs/main/noarch::google-auth-oauthlib-0.4.1-py_2
  google-pasta       pkgs/main/noarch::google-pasta-0.2.0-pyhd3eb1b0_0
  grpcio             pkgs/main/linux-64::grpcio-1.42.0-py39hce63b2e_0
  h5py               pkgs/main/linux-64::h5py-3.6.0-py39ha0f2276_0
  hdf5               pkgs/main/linux-64::hdf5-1.10.6-hb1b8bf9_0
  icu                pkgs/main/linux-64::icu-68.1-h2531618_0
  idna               pkgs/main/noarch::idna-3.3-pyhd3eb1b0_0
  importlib-metadata pkgs/main/linux-64::importlib-metadata-4.8.2-py39h06a4308_0
  intel-openmp       pkgs/main/linux-64::intel-openmp-2021.4.0-h06a4308_3561
  jpeg               pkgs/main/linux-64::jpeg-9d-h7f8727e_0
  keras-preprocessi~ pkgs/main/noarch::keras-preprocessing-1.1.2-pyhd3eb1b0_0
  krb5               pkgs/main/linux-64::krb5-1.19.2-hac12032_0
  libcurl            pkgs/main/linux-64::libcurl-7.80.0-h0b77cf5_0
  libedit            pkgs/main/linux-64::libedit-3.1.20210910-h7f8727e_0
  libev              pkgs/main/linux-64::libev-4.33-h7f8727e_1
  libgfortran-ng     pkgs/main/linux-64::libgfortran-ng-7.5.0-ha8ba4b0_17
  libgfortran4       pkgs/main/linux-64::libgfortran4-7.5.0-ha8ba4b0_17
  libnghttp2         pkgs/main/linux-64::libnghttp2-1.46.0-hce63b2e_0
  libpng             pkgs/main/linux-64::libpng-1.6.37-hbc83047_0
  libprotobuf        pkgs/main/linux-64::libprotobuf-3.14.0-h8c45485_0
  libssh2            pkgs/main/linux-64::libssh2-1.9.0-h1ba5d50_1
  markdown           pkgs/main/linux-64::markdown-3.3.4-py39h06a4308_0
  mkl                pkgs/main/linux-64::mkl-2021.4.0-h06a4308_640
  mkl-service        pkgs/main/linux-64::mkl-service-2.4.0-py39h7f8727e_0
  mkl_fft            pkgs/main/linux-64::mkl_fft-1.3.1-py39hd3c417c_0
  mkl_random         pkgs/main/linux-64::mkl_random-1.2.2-py39h51133e4_0
  multidict          pkgs/main/linux-64::multidict-5.2.0-py39h7f8727e_2
  numpy              pkgs/main/linux-64::numpy-1.21.2-py39h20f2e39_0
  numpy-base         pkgs/main/linux-64::numpy-base-1.21.2-py39h79a1101_0
  oauthlib           pkgs/main/noarch::oauthlib-3.1.1-pyhd3eb1b0_0
  opt_einsum         pkgs/main/noarch::opt_einsum-3.3.0-pyhd3eb1b0_1
  protobuf           pkgs/main/linux-64::protobuf-3.14.0-py39h2531618_1
  pyasn1             pkgs/main/noarch::pyasn1-0.4.8-pyhd3eb1b0_0
  pyasn1-modules     pkgs/main/noarch::pyasn1-modules-0.2.8-py_0
  pycparser          pkgs/main/noarch::pycparser-2.21-pyhd3eb1b0_0
  pyjwt              pkgs/main/linux-64::pyjwt-2.1.0-py39h06a4308_0
  pyopenssl          pkgs/main/noarch::pyopenssl-21.0.0-pyhd3eb1b0_1
  pysocks            pkgs/main/linux-64::pysocks-1.7.1-py39h06a4308_0
  python-flatbuffers pkgs/main/noarch::python-flatbuffers-1.12-pyhd3eb1b0_0
  requests           pkgs/main/noarch::requests-2.27.1-pyhd3eb1b0_0
  requests-oauthlib  pkgs/main/noarch::requests-oauthlib-1.3.0-py_0
  rsa                pkgs/main/noarch::rsa-4.7.2-pyhd3eb1b0_1
  scipy              pkgs/main/linux-64::scipy-1.7.3-py39hc147768_0
  six                pkgs/main/noarch::six-1.16.0-pyhd3eb1b0_0
  snappy             pkgs/main/linux-64::snappy-1.1.8-he6710b0_0
  tensorboard        pkgs/main/noarch::tensorboard-2.5.0-py_0
  tensorboard-plugi~ pkgs/main/noarch::tensorboard-plugin-wit-1.6.0-py_0
  tensorflow         pkgs/main/linux-64::tensorflow-2.5.0-mkl_py39h4a0693c_0
  tensorflow-base    pkgs/main/linux-64::tensorflow-base-2.5.0-mkl_py39h35b2a3d_0
  tensorflow-estima~ pkgs/main/noarch::tensorflow-estimator-2.5.0-pyh7b7c402_0
  termcolor          pkgs/main/linux-64::termcolor-1.1.0-py39h06a4308_1
  typing-extensions  pkgs/main/noarch::typing-extensions-3.10.0.2-hd3eb1b0_0
  typing_extensions  pkgs/main/noarch::typing_extensions-3.10.0.2-pyh06a4308_0
  urllib3            pkgs/main/noarch::urllib3-1.26.8-pyhd3eb1b0_0
  werkzeug           pkgs/main/noarch::werkzeug-2.0.2-pyhd3eb1b0_0
  wrapt              pkgs/main/linux-64::wrapt-1.13.3-py39h7f8727e_2
  yarl               pkgs/main/linux-64::yarl-1.6.3-py39h27cfd23_0
  zipp               pkgs/main/noarch::zipp-3.7.0-pyhd3eb1b0_0

The following packages will be DOWNGRADED:

  wheel                                 0.37.1-pyhd3eb1b0_0 --> 0.35.1-pyhd3eb1b0_0


Proceed ([y]/n)? y


Downloading and Extracting Packages
tensorflow-base-2.5. | 75.4 MB   | ################################################################### | 100% 
tensorflow-2.5.0     | 4 KB      | ################################################################### | 100% 
tensorflow-estimator | 267 KB    | ################################################################### | 100% 
abseil-cpp-20200923. | 919 KB    | ################################################################### | 100% 
tensorboard-2.5.0    | 5.3 MB    | ################################################################### | 100% 
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
(mytensorflow25) myenv@srv ~ $ python -c "import tensorflow as tf;print(tf.reduce_sum(tf.random.normal([1000, 1000])))"
2022-02-01 07:45:57.587778: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  SSE4.1 SSE4.2 AVX AVX2 FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2022-02-01 07:45:57.589316: I tensorflow/core/common_runtime/process_util.cc:146] Creating new thread pool with default inter op setting: 2. Tune using inter_op_parallelism_threads for best performance.
tf.Tensor(694.0089, shape=(), dtype=float32)
(mytensorflow25) myenv@srv ~ $

STEP 4) List all conda installed environments

(mytensorflow25) myenv@srv ~ $ conda env list
# conda environments:
#
base                     /home/myenv/miniconda3
mypython37               /home/myenv/miniconda3/envs/mypython37
mytensorflow25        *  /home/myenv/miniconda3/envs/mytensorflow25
mytensorflow26           /home/myenv/miniconda3/envs/mytensorflow26
test_env                 /home/myenv/miniconda3/envs/test_env

Now there are two different versions of TensorFlow installed in two different environments and using one another is just a matter of a single activate command:

(mytensorflow25) myenv@srv ~ $ conda activate mytensorflow26
(mytensorflow26) myenv@srv ~ $ python -V
Python 3.9.7
(mytensorflow26) myenv@srv ~ $ conda activate mytensorflow25
(mytensorflow25) myenv@srv ~ $ conda activate mypython37    
(mypython37) myenv@srv ~ $ conda deactivate
(mytensorflow25) myenv@srv ~ $ conda deactivate
(base) myenv@srv ~ $

Exporting and importing complex environments like TensorFlow is easy, too. Check out the following article – conda export environment and conda import environment

Leave a Reply

Your email address will not be published.