anaconda3部署以及使用详解

 

Anaconda3-2019.10-Linux-x86_64.sh

某次执行Python程序,其中两个错误信息如下:

ImportError: libcblas.so.3: cannot open shared object file: No such file or directory
Original error was: libcblas.so.3: cannot open shared object file: No such file or directory

 

问题:部署anaconda3卡在Unpacking payload,不能解压

[root@mcw6 ~]$ bash Anaconda3-2019.10-Linux-x86_64.sh

Anaconda3 will now be installed into this location:
/home/machangwei/anaconda3

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

[/home/machangwei/anaconda3] >>> 
PREFIX=/home/machangwei/anaconda3
Unpacking payload ...
  0%|                                                                                                                                                     | 0/29

解决方案:之前虚拟机是1核,改成2核就可以了  

[root@mcw6 ~]$ lscpu|grep CPU  
CPU op-mode(s):        32-bit, 64-bit
CPU(s):                2

部署anaconda3

[root@mcw6 ~]$ bash Anaconda3-2019.10-Linux-x86_64.sh
根据提示操作即可:press ENTER 或 输入 yes

Please answer 'yes' or 'no':'
>>> yes

Anaconda3 will now be installed into this location:
/home/machangwei/anaconda3

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

[/home/machangwei/anaconda3] >>>    #这里直接按enter键,那anaconda3直接部署到命令执行的当前目录下。如果这里填写路径,
PREFIX=/root/anaconda3   #那么直接部署到填写的路径下,假设写个yes,那么直接在当前目录下创建个 yes目录,里面安装上anaconda3
Unpacking payload ...  
  0%|                                                                                                                                                     | 0/291 [00:00<?, ?it/s]^CProcess ForkProcess-1:




成功安装anaconda3之后,添加环境变量
[root@mcw6 ~]$ vim /etc/profile
[root@mcw6 ~]$ tail -2 /etc/profile
export ANACONDA_HOME=/root/anaconda3
export PATH=$PATH:$ANACONDA_HOME/bin:$ANACONDA_HOME/sbin
[root@mcw6 ~]$ source /etc/profile
[root@mcw6 ~]$ conda update conda  #没有联网,不能更新
root@mcw6 ~]$ conda create -n python37 python=3.7 --offline   #可离线创建Python虚拟环境
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /root/anaconda3/envs/python37

  added / updated specs:
    - python=3.7


The following NEW packages will be INSTALLED:

  _libgcc_mutex      pkgs/main/linux-64::_libgcc_mutex-0.1-main
  ca-certificates    pkgs/main/linux-64::ca-certificates-2019.8.28-0
  libedit            pkgs/main/linux-64::libedit-3.1.20181209-hc058e9b_0
  libffi             pkgs/main/linux-64::libffi-3.2.1-hd88cf55_4
  libgcc-ng          pkgs/main/linux-64::libgcc-ng-9.1.0-hdf63c60_0
  libstdcxx-ng       pkgs/main/linux-64::libstdcxx-ng-9.1.0-hdf63c60_0
  ncurses            pkgs/main/linux-64::ncurses-6.1-he6710b0_1
  openssl            pkgs/main/linux-64::openssl-1.1.1d-h7b6447c_2
  python             pkgs/main/linux-64::python-3.7.4-h265db76_1
  readline           pkgs/main/linux-64::readline-7.0-h7b6447c_5
  sqlite             pkgs/main/linux-64::sqlite-3.30.0-h7b6447c_0
  tk                 pkgs/main/linux-64::tk-8.6.8-hbc83047_0
  xz                 pkgs/main/linux-64::xz-5.2.4-h14c3975_4
  zlib               pkgs/main/linux-64::zlib-1.2.11-h7b6447c_3


Proceed ([y]/n)? y

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

[root@mcw6 ~]$ conda install pip --offline
Collecting package metadata (current_repodata.json): done
Solving environment: done

# All requested packages already installed.

[root@mcw6 ~]$ activate python37

[root@mcw6 ~]$ conda env list
# conda environments:
#
base                  *  /root/anaconda3
python37                 /root/anaconda3/envs/python37
[root@mcw6 ~]$ source activate
(base) [root@mcw6 ~]$ conda activate python37
(python37) [root@mcw6 ~]$ 
(python37) [root@mcw6 ~]$ 
(python37) [root@mcw6 ~]$ conda deactivate
(base) [root@mcw6 ~]$ conda deactivate
[root@mcw6 ~]$ 


[root@mcw6 ~]$ ls anaconda3/lib|grep libblas  
[root@mcw6 ~]$


未联网执行命令安装也是无法安装上
[root@mcw6 ~]$ conda install -c conda-forge prophet
Collecting package metadata (current_repodata.json): failed

CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://conda.anaconda.org/conda-forge/linux-64/current_repodata.json>
Elapsed: -

An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.
ConnectionError(MaxRetryError("HTTPSConnectionPool(host='conda.anaconda.org', port=443): Max retries exceeded with url: /conda-forge/linux-64/current_repodata.json (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f0e7976ebd0>: Failed to establish a new connection: [Errno -2] Name or service not known'))"))
[root@mcw6 ~]$ conda install gcc 5.0.0


把无外网环境,弄成有外网环境
[root@mcw6 ~]$ systemctl restart network
[root@mcw6 ~]$ 
[root@mcw6 ~]$ 
[root@mcw6 ~]$ vim /etc/resolv.conf 
[root@mcw6 ~]$ ping www.baidu.com
PING www.a.shifen.com (220.181.38.149) 56(84) bytes of data.
64 bytes from 220.181.38.149 (220.181.38.149): icmp_seq=2 ttl=128 time=4.22 ms
^C
--- www.a.shifen.com ping statistics ---
2 packets transmitted, 1 received, 50% packet loss, time 1000ms
rtt min/avg/max/mdev = 4.222/4.222/4.222/0.000 ms
[root@mcw6 ~]$ 


退出会话重新连接时,进入base环境
(base) [root@mcw6 ~]$ conda env list
# conda environments:
#
base                  *  /root/anaconda3
python37                 /root/anaconda3/envs/python37

(base) [root@mcw6 ~]$ 

conda 安装

执行安装命令之后conda install -c conda-forge prophet

就下载安装了libblas-3.9.0        | 12 KB     | #################### | 100% 

必须联网才能更新和安装新的包。跟创建虚拟环境不同,虚拟环境需要的它本身自带了,应该是这样的。

base环境执行安装命令解析环境失败,还得进Python虚拟 环境才执行安装命令成功
(base) [root@mcw6 ~]$ conda install -c conda-forge prophet
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.

刚刚看错位置了,应该看这里。执行命令安装成功之后。如下,虚拟环境中增加了库文件。
(base) [root@mcw6 ~]$ ls anaconda3/envs/python37/lib/|grep libblas
libblas.so
libblas.so.3

以下为执行conda install安装命令的全过程

(python37) [root@mcw6 ~]$ conda install -c conda-forge prophet
Collecting package metadata (current_repodata.json): done
Solving environment: done


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

Please update conda by running

    $ conda update -n base -c defaults conda



## Package Plan ##

  environment location: /root/anaconda3/envs/python37

  added / updated specs:
    - prophet


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    _libgcc_mutex-0.1          |      conda_forge           3 KB  conda-forge
    _openmp_mutex-4.5          |            1_gnu          22 KB  conda-forge
    arviz-0.11.4               |     pyhd8ed1ab_0         1.4 MB  conda-forge
    binutils_impl_linux-64-2.36.1|       h193b22a_2        10.4 MB  conda-forge
    binutils_linux-64-2.36     |      hf3e587d_33          22 KB  conda-forge
    bzip2-1.0.8                |       h7f98852_4         484 KB  conda-forge
    c-ares-1.18.1              |       h7f98852_0         113 KB  conda-forge
    ca-certificates-2021.10.8  |       ha878542_0         139 KB  conda-forge
    cftime-1.5.1.1             |   py37hb1e94ed_1         229 KB  conda-forge
    colorama-0.4.4             |     pyh9f0ad1d_0          18 KB  conda-forge
    convertdate-2.3.2          |     pyhd8ed1ab_0          37 KB  conda-forge
    curl-7.78.0                |       h1ccaba5_0          94 KB
    cycler-0.11.0              |     pyhd8ed1ab_0          10 KB  conda-forge
    cython-0.29.26             |   py37hcd2ae1e_0         2.2 MB  conda-forge
    ephem-4.1.3                |   py37h5e8e339_1         1.4 MB  conda-forge
    freetype-2.10.4            |       h0708190_1         890 KB  conda-forge
    gcc_impl_linux-64-7.5.0    |      habd7529_19        38.3 MB  conda-forge
    gcc_linux-64-7.5.0         |      h47867f9_33          23 KB  conda-forge
    gxx_impl_linux-64-7.5.0    |      hd0bb8aa_19         9.5 MB  conda-forge
    gxx_linux-64-7.5.0         |      h555fc39_33          23 KB  conda-forge
    hdf4-4.2.15                |       h10796ff_3         950 KB  conda-forge
    hdf5-1.12.1                |nompi_h2750804_100         3.5 MB  conda-forge
    hijri-converter-2.2.2      |     pyhd8ed1ab_0          17 KB  conda-forge
    holidays-0.12              |     pyhd8ed1ab_0          82 KB  conda-forge
    icu-67.1                   |       he1b5a44_0        12.9 MB  conda-forge
    importlib-metadata-4.10.1  |   py37h89c1867_0          32 KB  conda-forge
    importlib_metadata-4.10.1  |       hd8ed1ab_0           4 KB  conda-forge
    jpeg-9d                    |       h36c2ea0_0         264 KB  conda-forge
    kernel-headers_linux-64-2.6.32|      he073ed8_15         707 KB  conda-forge
    kiwisolver-1.3.2           |   py37h2527ec5_1          78 KB  conda-forge
    korean_lunar_calendar-0.2.1|     pyh9f0ad1d_0          10 KB  conda-forge
    krb5-1.19.2                |       hcc1bbae_3         1.4 MB  conda-forge
    ld_impl_linux-64-2.36.1    |       hea4e1c9_2         667 KB  conda-forge
    libblas-3.9.0              |13_linux64_openblas          12 KB  conda-forge
    libcblas-3.9.0             |13_linux64_openblas          12 KB  conda-forge
    libcurl-7.78.0             |       h0b77cf5_0         338 KB
    libedit-3.1.20191231       |       h46ee950_2         121 KB  conda-forge
    libev-4.33                 |       h516909a_1         104 KB  conda-forge
    libgcc-devel_linux-64-7.5.0|      hda03d7c_19         3.6 MB  conda-forge
    libgcc-ng-11.2.0           |      h1d223b6_11         887 KB  conda-forge
    libgfortran-ng-11.2.0      |      h69a702a_11          19 KB  conda-forge
    libgfortran5-11.2.0        |      h5c6108e_11         1.7 MB  conda-forge
    libgomp-11.2.0             |      h1d223b6_11         427 KB  conda-forge
    liblapack-3.9.0            |13_linux64_openblas          12 KB  conda-forge
    libnetcdf-4.8.1            |nompi_hb3fd0d9_101         1.5 MB  conda-forge
    libnghttp2-1.43.0          |       h812cca2_1         790 KB  conda-forge
    libopenblas-0.3.18         |pthreads_h8fe5266_0         9.6 MB  conda-forge
    libpng-1.6.37              |       h21135ba_2         306 KB  conda-forge
    libssh2-1.10.0             |       ha56f1ee_2         233 KB  conda-forge
    libstdcxx-devel_linux-64-7.5.0|      hb016644_19         9.3 MB  conda-forge
    libstdcxx-ng-11.2.0        |      he4da1e4_11         4.2 MB  conda-forge
    libzip-1.8.0               |       h4de3113_1         126 KB  conda-forge
    lunarcalendar-0.0.9        |             py_0          20 KB  conda-forge
    matplotlib-base-3.2.2      |   py37h1d35a4c_1         7.0 MB  conda-forge
    netcdf4-1.5.8              |nompi_py37hf784469_101         525 KB  conda-forge
    numpy-1.21.5               |   py37hf2998dd_0         6.1 MB  conda-forge
    openssl-1.1.1l             |       h7f98852_0         2.1 MB  conda-forge
    packaging-21.3             |     pyhd8ed1ab_0          36 KB  conda-forge
    pandas-1.3.5               |   py37he8f5f7f_0        12.7 MB  conda-forge
    prophet-1.0.1              |   py37h085eea5_3         688 KB  conda-forge
    pymeeus-0.5.10             |     pyhd8ed1ab_0         534 KB  conda-forge
    pyparsing-3.0.6            |     pyhd8ed1ab_0          79 KB  conda-forge
    pystan-2.19.1.1            |   py37h9fdb41a_2        17.3 MB  conda-forge
    python-dateutil-2.8.2      |     pyhd8ed1ab_0         240 KB  conda-forge
    python_abi-3.7             |          2_cp37m           4 KB  conda-forge
    pytz-2021.3                |     pyhd8ed1ab_0         242 KB  conda-forge
    scipy-1.7.3                |   py37hf2a6cf1_0        21.8 MB  conda-forge
    setuptools-59.8.0          |   py37h89c1867_0         1.0 MB  conda-forge
    six-1.16.0                 |     pyh6c4a22f_0          14 KB  conda-forge
    sysroot_linux-64-2.12      |      he073ed8_15        31.4 MB  conda-forge
    tk-8.6.11                  |       h27826a3_1         3.3 MB  conda-forge
    tornado-6.1                |   py37h5e8e339_2         642 KB  conda-forge
    tqdm-4.62.3                |     pyhd8ed1ab_0          80 KB  conda-forge
    typing_extensions-3.10.0.2 |     pyha770c72_0          28 KB  conda-forge
    xarray-0.20.2              |     pyhd8ed1ab_0         628 KB  conda-forge
    zipp-3.7.0                 |     pyhd8ed1ab_0          12 KB  conda-forge
    ------------------------------------------------------------
                                           Total:       225.4 MB

The following NEW packages will be INSTALLED:

  _openmp_mutex      conda-forge/linux-64::_openmp_mutex-4.5-1_gnu
  arviz              conda-forge/noarch::arviz-0.11.4-pyhd8ed1ab_0
  binutils_impl_lin~ conda-forge/linux-64::binutils_impl_linux-64-2.36.1-h193b22a_2
  binutils_linux-64  conda-forge/linux-64::binutils_linux-64-2.36-hf3e587d_33
  bzip2              conda-forge/linux-64::bzip2-1.0.8-h7f98852_4
  c-ares             conda-forge/linux-64::c-ares-1.18.1-h7f98852_0
  cftime             conda-forge/linux-64::cftime-1.5.1.1-py37hb1e94ed_1
  colorama           conda-forge/noarch::colorama-0.4.4-pyh9f0ad1d_0
  convertdate        conda-forge/noarch::convertdate-2.3.2-pyhd8ed1ab_0
  curl               pkgs/main/linux-64::curl-7.78.0-h1ccaba5_0
  cycler             conda-forge/noarch::cycler-0.11.0-pyhd8ed1ab_0
  cython             conda-forge/linux-64::cython-0.29.26-py37hcd2ae1e_0
  ephem              conda-forge/linux-64::ephem-4.1.3-py37h5e8e339_1
  freetype           conda-forge/linux-64::freetype-2.10.4-h0708190_1
  gcc_impl_linux-64  conda-forge/linux-64::gcc_impl_linux-64-7.5.0-habd7529_19
  gcc_linux-64       conda-forge/linux-64::gcc_linux-64-7.5.0-h47867f9_33
  gxx_impl_linux-64  conda-forge/linux-64::gxx_impl_linux-64-7.5.0-hd0bb8aa_19
  gxx_linux-64       conda-forge/linux-64::gxx_linux-64-7.5.0-h555fc39_33
  hdf4               conda-forge/linux-64::hdf4-4.2.15-h10796ff_3
  hdf5               conda-forge/linux-64::hdf5-1.12.1-nompi_h2750804_100
  hijri-converter    conda-forge/noarch::hijri-converter-2.2.2-pyhd8ed1ab_0
  holidays           conda-forge/noarch::holidays-0.12-pyhd8ed1ab_0
  icu                conda-forge/linux-64::icu-67.1-he1b5a44_0
  importlib-metadata conda-forge/linux-64::importlib-metadata-4.10.1-py37h89c1867_0
  importlib_metadata conda-forge/noarch::importlib_metadata-4.10.1-hd8ed1ab_0
  jpeg               conda-forge/linux-64::jpeg-9d-h36c2ea0_0
  kernel-headers_li~ conda-forge/noarch::kernel-headers_linux-64-2.6.32-he073ed8_15
  kiwisolver         conda-forge/linux-64::kiwisolver-1.3.2-py37h2527ec5_1
  korean_lunar_cale~ conda-forge/noarch::korean_lunar_calendar-0.2.1-pyh9f0ad1d_0
  krb5               conda-forge/linux-64::krb5-1.19.2-hcc1bbae_3
  ld_impl_linux-64   conda-forge/linux-64::ld_impl_linux-64-2.36.1-hea4e1c9_2
  libblas            conda-forge/linux-64::libblas-3.9.0-13_linux64_openblas
  libcblas           conda-forge/linux-64::libcblas-3.9.0-13_linux64_openblas
  libcurl            pkgs/main/linux-64::libcurl-7.78.0-h0b77cf5_0
  libev              conda-forge/linux-64::libev-4.33-h516909a_1
  libgcc-devel_linu~ conda-forge/linux-64::libgcc-devel_linux-64-7.5.0-hda03d7c_19
  libgfortran-ng     conda-forge/linux-64::libgfortran-ng-11.2.0-h69a702a_11
  libgfortran5       conda-forge/linux-64::libgfortran5-11.2.0-h5c6108e_11
  libgomp            conda-forge/linux-64::libgomp-11.2.0-h1d223b6_11
  liblapack          conda-forge/linux-64::liblapack-3.9.0-13_linux64_openblas
  libnetcdf          conda-forge/linux-64::libnetcdf-4.8.1-nompi_hb3fd0d9_101
  libnghttp2         conda-forge/linux-64::libnghttp2-1.43.0-h812cca2_1
  libopenblas        conda-forge/linux-64::libopenblas-0.3.18-pthreads_h8fe5266_0
  libpng             conda-forge/linux-64::libpng-1.6.37-h21135ba_2
  libssh2            conda-forge/linux-64::libssh2-1.10.0-ha56f1ee_2
  libstdcxx-devel_l~ conda-forge/linux-64::libstdcxx-devel_linux-64-7.5.0-hb016644_19
  libzip             conda-forge/linux-64::libzip-1.8.0-h4de3113_1
  lunarcalendar      conda-forge/noarch::lunarcalendar-0.0.9-py_0
  matplotlib-base    conda-forge/linux-64::matplotlib-base-3.2.2-py37h1d35a4c_1
  netcdf4            conda-forge/linux-64::netcdf4-1.5.8-nompi_py37hf784469_101
  numpy              conda-forge/linux-64::numpy-1.21.5-py37hf2998dd_0
  packaging          conda-forge/noarch::packaging-21.3-pyhd8ed1ab_0
  pandas             conda-forge/linux-64::pandas-1.3.5-py37he8f5f7f_0
  prophet            conda-forge/linux-64::prophet-1.0.1-py37h085eea5_3
  pymeeus            conda-forge/noarch::pymeeus-0.5.10-pyhd8ed1ab_0
  pyparsing          conda-forge/noarch::pyparsing-3.0.6-pyhd8ed1ab_0
  pystan             conda-forge/linux-64::pystan-2.19.1.1-py37h9fdb41a_2
  python-dateutil    conda-forge/noarch::python-dateutil-2.8.2-pyhd8ed1ab_0
  python_abi         conda-forge/linux-64::python_abi-3.7-2_cp37m
  pytz               conda-forge/noarch::pytz-2021.3-pyhd8ed1ab_0
  scipy              conda-forge/linux-64::scipy-1.7.3-py37hf2a6cf1_0
  setuptools         conda-forge/linux-64::setuptools-59.8.0-py37h89c1867_0
  six                conda-forge/noarch::six-1.16.0-pyh6c4a22f_0
  sysroot_linux-64   conda-forge/noarch::sysroot_linux-64-2.12-he073ed8_15
  tornado            conda-forge/linux-64::tornado-6.1-py37h5e8e339_2
  tqdm               conda-forge/noarch::tqdm-4.62.3-pyhd8ed1ab_0
  typing_extensions  conda-forge/noarch::typing_extensions-3.10.0.2-pyha770c72_0
  xarray             conda-forge/noarch::xarray-0.20.2-pyhd8ed1ab_0
  zipp               conda-forge/noarch::zipp-3.7.0-pyhd8ed1ab_0

The following packages will be UPDATED:

  ca-certificates    pkgs/main::ca-certificates-2019.8.28-0 --> conda-forge::ca-certificates-2021.10.8-ha878542_0
  libedit            pkgs/main::libedit-3.1.20181209-hc058~ --> conda-forge::libedit-3.1.20191231-h46ee950_2
  libgcc-ng           pkgs/main::libgcc-ng-9.1.0-hdf63c60_0 --> conda-forge::libgcc-ng-11.2.0-h1d223b6_11
  libstdcxx-ng       pkgs/main::libstdcxx-ng-9.1.0-hdf63c6~ --> conda-forge::libstdcxx-ng-11.2.0-he4da1e4_11
  openssl              pkgs/main::openssl-1.1.1d-h7b6447c_2 --> conda-forge::openssl-1.1.1l-h7f98852_0
  tk                         pkgs/main::tk-8.6.8-hbc83047_0 --> conda-forge::tk-8.6.11-h27826a3_1

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

  _libgcc_mutex           pkgs/main::_libgcc_mutex-0.1-main --> conda-forge::_libgcc_mutex-0.1-conda_forge


Proceed ([y]/n)? yes


Downloading and Extracting Packages
hdf5-1.12.1          | 3.5 MB    | ########## | 100% 
python-dateutil-2.8. | 240 KB    | ########## | 100% 
c-ares-1.18.1        | 113 KB    | ########## | 100% 
holidays-0.12        | 82 KB     | ########## | 100% 
_libgcc_mutex-0.1    | 3 KB      | ########## | 100% 
libgomp-11.2.0       | 427 KB    | ########## | 100% 
libedit-3.1.20191231 | 121 KB    | ########## | 100% 
prophet-1.0.1        | 688 KB    | ########## | 100% 
kernel-headers_linux | 707 KB    | ########## | 100% 
hijri-converter-2.2. | 17 KB     | ########## | 100% 
korean_lunar_calenda | 10 KB     | ########## | 100% 
libgfortran-ng-11.2. | 19 KB     | ########## | 100% 
cython-0.29.26       | 2.2 MB    | ########## | 100% 
importlib-metadata-4 | 32 KB     | ########## | 100% 
sysroot_linux-64-2.1 | 31.4 MB   | ########## | 100% 
gxx_linux-64-7.5.0   | 23 KB     | ########## | 100% 
libblas-3.9.0        | 12 KB     | ########## | 100% 
libnghttp2-1.43.0    | 790 KB    | ########## | 100% 
pytz-2021.3          | 242 KB    | ########## | 100% 
libcblas-3.9.0       | 12 KB     | ########## | 100% 
freetype-2.10.4      | 890 KB    | ########## | 100% 
typing_extensions-3. | 28 KB     | ########## | 100% 
numpy-1.21.5         | 6.1 MB    | ########## | 100% 
gcc_linux-64-7.5.0   | 23 KB     | ########## | 100% 
pymeeus-0.5.10       | 534 KB    | ########## | 100% 
gxx_impl_linux-64-7. | 9.5 MB    | ########## | 100% 
hdf4-4.2.15          | 950 KB    | ########## | 100% 
jpeg-9d              | 264 KB    | ########## | 100% 
python_abi-3.7       | 4 KB      | ########## | 100% 
six-1.16.0           | 14 KB     | ########## | 100% 
cycler-0.11.0        | 10 KB     | ########## | 100% 
pyparsing-3.0.6      | 79 KB     | ########## | 100% 
ephem-4.1.3          | 1.4 MB    | ########## | 100% 
libpng-1.6.37        | 306 KB    | ########## | 100% 
zipp-3.7.0           | 12 KB     | ########## | 100% 
tornado-6.1          | 642 KB    | ########## | 100% 
binutils_linux-64-2. | 22 KB     | ########## | 100% 
convertdate-2.3.2    | 37 KB     | ########## | 100% 
xarray-0.20.2        | 628 KB    | ########## | 100% 
kiwisolver-1.3.2     | 78 KB     | ########## | 100% 
setuptools-59.8.0    | 1.0 MB    | ########## | 100% 
pystan-2.19.1.1      | 17.3 MB   | ########## | 100% 
libstdcxx-ng-11.2.0  | 4.2 MB    | ########## | 100% 
_openmp_mutex-4.5    | 22 KB     | ########## | 100% 
tk-8.6.11            | 3.3 MB    | ########## | 100% 
curl-7.78.0          | 94 KB     | ########## | 100% 
libnetcdf-4.8.1      | 1.5 MB    | ########## | 100% 
pandas-1.3.5         | 12.7 MB   | ########## | 100% 
libssh2-1.10.0       | 233 KB    | ########## | 100% 
libzip-1.8.0         | 126 KB    | ########## | 100% 
scipy-1.7.3          | 21.8 MB   | ########## | 100% 
colorama-0.4.4       | 18 KB     | ########## | 100% 
cftime-1.5.1.1       | 229 KB    | ########## | 100% 
icu-67.1             | 12.9 MB   | ########## | 100% 
bzip2-1.0.8          | 484 KB    | ########## | 100% 
libgcc-devel_linux-6 | 3.6 MB    | ########## | 100% 
libcurl-7.78.0       | 338 KB    | ########## | 100% 
libstdcxx-devel_linu | 9.3 MB    | ########## | 100% 
ld_impl_linux-64-2.3 | 667 KB    | ########## | 100% 
libgcc-ng-11.2.0     | 887 KB    | ########## | 100% 
libopenblas-0.3.18   | 9.6 MB    | ########## | 100% 
importlib_metadata-4 | 4 KB      | ########## | 100% 
gcc_impl_linux-64-7. | 38.3 MB   | ########## | 100% 
lunarcalendar-0.0.9  | 20 KB     | ########## | 100% 
libev-4.33           | 104 KB    | ########## | 100% 
arviz-0.11.4         | 1.4 MB    | ########## | 100% 
ca-certificates-2021 | 139 KB    | ########## | 100% 
binutils_impl_linux- | 10.4 MB   | ########## | 100% 
krb5-1.19.2          | 1.4 MB    | ########## | 100% 
liblapack-3.9.0      | 12 KB     | ########## | 100% 
tqdm-4.62.3          | 80 KB     | ########## | 100% 
libgfortran5-11.2.0  | 1.7 MB    | ########## | 100% 
netcdf4-1.5.8        | 525 KB    | ########## | 100% 
openssl-1.1.1l       | 2.1 MB    | ########## | 100% 
matplotlib-base-3.2. | 7.0 MB    | ########## | 100% 
packaging-21.3       | 36 KB     | ########## | 100% 
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
(python37) [root@mcw6 ~]$ 

 

conda list 查看,不同的环境,包存在差异

(base) [root@mcw6 ~]$ conda list|grep libblas
(base) [root@mcw6 ~]$ conda activate python37
(python37) [root@mcw6 ~]$ conda list|grep libblas
libblas                   3.9.0           13_linux64_openblas    conda-forge
(python37) [root@mcw6 ~]$ 

查看之前执行Python程序报错没有libcblas.so.3,已经通过上面的安装命令而安装进了Python虚拟环境中

(python37) [root@mcw6 ~]$ conda list|grep libcb
libcblas                  3.9.0           13_linux64_openblas    conda-forge
(python37) [root@mcw6 ~]$ ls anaconda3/envs/python37/lib/|grep libcb
libcblas.so
libcblas.so.3
(python37) [root@mcw6 ~]$ 

 

总结:

1、以后研究:conda 只下载不安装,然后将包上传到离线环境conda install安装,是否支持,以后研究
2、以后验证:anaconda3 直接复制目录到其它目录或主机,添加环境变量后是否能直接使用。如果有虚拟环境,只需替换Python虚拟环境中的site-package目录。
3、conda install ,它好像是进入Python虚拟环境中执行,base中没执行成功。这样它安装了很多文件,它都安装在anaconda3目录下,应该是安装到Python虚拟环境中。可能不是安装到site-package目录下,安装模块。可能安装到Python虚拟环境的lib目录下。比如libblas.so,libblas.so.3,感觉像是系统库文件似的。

4、生产环境anaconda3缺少7个文件,都是在lib下缺少的,.so .so.3这种的。通过执行程序,查看跟生产环境一致的anaconda3的Python虚拟环境中缺少那个文件,就从正常的环境中将文件复制过去。缺谁补谁,最终成功解决问题。

5、还有很多conda命令使用,以后有时间补充

 

上一篇:如果在线上遇到了OOM,该如何解决?


下一篇:PHP 按行读取文件内容并截取每行指定字符串之间的内容组成数组