2019/10/21

miniconda -- ubuntu 18.04 for caffe

Miniconda3 will now be installed into this location:
/home/charles-chang/miniconda3

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

[/home/charles-chang/miniconda3] >>> 
PREFIX=/home/charles-chang/miniconda3
Unpacking payload ...
Collecting package metadata (current_repodata.json): done                                                                
Solving environment: done

## Package Plan ##

  environment location: /home/charles-chang/miniconda3

  added / updated specs:
    - _libgcc_mutex==0.1=main
    - asn1crypto==1.0.1=py37_0
    - ca-certificates==2019.8.28=0
    - certifi==2019.9.11=py37_0
    - cffi==1.12.3=py37h2e261b9_0
    - chardet==3.0.4=py37_1003
    - conda-package-handling==1.6.0=py37h7b6447c_0
    - conda==4.7.12=py37_0
    - cryptography==2.7=py37h1ba5d50_0
    - idna==2.8=py37_0
    - libedit==3.1.20181209=hc058e9b_0
    - libffi==3.2.1=hd88cf55_4
    - libgcc-ng==9.1.0=hdf63c60_0
    - libstdcxx-ng==9.1.0=hdf63c60_0
    - ncurses==6.1=he6710b0_1
    - openssl==1.1.1d=h7b6447c_2
    - pip==19.2.3=py37_0
    - pycosat==0.6.3=py37h14c3975_0
    - pycparser==2.19=py37_0
    - pyopenssl==19.0.0=py37_0
    - pysocks==1.7.1=py37_0
    - python==3.7.4=h265db76_1
    - readline==7.0=h7b6447c_5
    - requests==2.22.0=py37_0
    - ruamel_yaml==0.15.46=py37h14c3975_0
    - setuptools==41.4.0=py37_0
    - six==1.12.0=py37_0
    - sqlite==3.30.0=h7b6447c_0
    - tk==8.6.8=hbc83047_0
    - tqdm==4.36.1=py_0
    - urllib3==1.24.2=py37_0
    - wheel==0.33.6=py37_0
    - xz==5.2.4=h14c3975_4
    - yaml==0.1.7=had09818_2
    - zlib==1.2.11=h7b6447c_3


The following NEW packages will be INSTALLED:

  _libgcc_mutex      pkgs/main/linux-64::_libgcc_mutex-0.1-main
  asn1crypto         pkgs/main/linux-64::asn1crypto-1.0.1-py37_0
  ca-certificates    pkgs/main/linux-64::ca-certificates-2019.8.28-0
  certifi            pkgs/main/linux-64::certifi-2019.9.11-py37_0
  cffi               pkgs/main/linux-64::cffi-1.12.3-py37h2e261b9_0
  chardet            pkgs/main/linux-64::chardet-3.0.4-py37_1003
  conda              pkgs/main/linux-64::conda-4.7.12-py37_0
  conda-package-han~ pkgs/main/linux-64::conda-package-handling-1.6.0-py37h7b6447c_0
  cryptography       pkgs/main/linux-64::cryptography-2.7-py37h1ba5d50_0
  idna               pkgs/main/linux-64::idna-2.8-py37_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
  pip                pkgs/main/linux-64::pip-19.2.3-py37_0
  pycosat            pkgs/main/linux-64::pycosat-0.6.3-py37h14c3975_0
  pycparser          pkgs/main/linux-64::pycparser-2.19-py37_0
  pyopenssl          pkgs/main/linux-64::pyopenssl-19.0.0-py37_0
  pysocks            pkgs/main/linux-64::pysocks-1.7.1-py37_0
  python             pkgs/main/linux-64::python-3.7.4-h265db76_1
  readline           pkgs/main/linux-64::readline-7.0-h7b6447c_5
  requests           pkgs/main/linux-64::requests-2.22.0-py37_0
  ruamel_yaml        pkgs/main/linux-64::ruamel_yaml-0.15.46-py37h14c3975_0
  setuptools         pkgs/main/linux-64::setuptools-41.4.0-py37_0
  six                pkgs/main/linux-64::six-1.12.0-py37_0
  sqlite             pkgs/main/linux-64::sqlite-3.30.0-h7b6447c_0
  tk                 pkgs/main/linux-64::tk-8.6.8-hbc83047_0
  tqdm               pkgs/main/noarch::tqdm-4.36.1-py_0
  urllib3            pkgs/main/linux-64::urllib3-1.24.2-py37_0
  wheel              pkgs/main/linux-64::wheel-0.33.6-py37_0
  xz                 pkgs/main/linux-64::xz-5.2.4-h14c3975_4
  yaml               pkgs/main/linux-64::yaml-0.1.7-had09818_2
  zlib               pkgs/main/linux-64::zlib-1.2.11-h7b6447c_3


Preparing transaction: done
Executing transaction: done
installation finished.
Do you wish the installer to initialize Miniconda3
by running conda init? [yes|no]
[no] >>> yes
no change     /home/charles-chang/miniconda3/condabin/conda
no change     /home/charles-chang/miniconda3/bin/conda
no change     /home/charles-chang/miniconda3/bin/conda-env
no change     /home/charles-chang/miniconda3/bin/activate
no change     /home/charles-chang/miniconda3/bin/deactivate
no change     /home/charles-chang/miniconda3/etc/profile.d/conda.sh
no change     /home/charles-chang/miniconda3/etc/fish/conf.d/conda.fish
no change     /home/charles-chang/miniconda3/shell/condabin/Conda.psm1
no change     /home/charles-chang/miniconda3/shell/condabin/conda-hook.ps1
no change     /home/charles-chang/miniconda3/lib/python3.7/site-packages/xontrib/conda.xsh
no change     /home/charles-chang/miniconda3/etc/profile.d/conda.csh
modified      /home/charles-chang/.bashrc

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

If you'd prefer that conda's base environment not be activated on startup, 
   set the auto_activate_base parameter to false: 

conda config --set auto_activate_base false

Thank you for installing Miniconda3!
然後一樣,把 ~/.bashrc 最後一段 copy 出來 ...condaenv.sh:
#!/bin/bash
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/charles-chang/miniconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
else
    if [ -f "/home/charles-chang/miniconda3/etc/profile.d/conda.sh" ]; then
        . "/home/charles-chang/miniconda3/etc/profile.d/conda.sh"
    else
        export PATH="/home/charles-chang/miniconda3/bin:$PATH"
    fi
fi
unset __conda_setup
果然...雖然 ubuntu 18.04 的 python3 是 python3.6。但是 conda 加裝了 python3.7...
所以現在的系統...
charles-chang@zoeymkII:~$ python --version
Python 2.7.15+
charles-chang@zoeymkII:~$ python3 --version
Python 3.6.8
charles-chang@zoeymkII:~$ source condaenv.sh 
(base) charles-chang@zoeymkII:~$ python --version
Python 3.7.4
(base) charles-chang@zoeymkII:~$
有三種版本....

conda 自動安裝的 python3.7 不包含 dev,所以 /usr/include 下沒有 python3.7, python3.7m
要的話,需要再 apt-get install libpython3.7-dev


OK, 這樣,source condaenv.sh 後,就可以使用 conda 了...
先 create new env and activate it..
conda create --name caffe
conda activate caffe
安裝 python3.6
conda install python=3.6
安裝 jupyter
conda install jupyter

沒有留言:

張貼留言