ryuiso2のブログ

ryuiso2のブログ

自分用のメモです。

コマンドラインでAnaconda環境を整える

 $ wget https://repo.anaconda.com/archive/Anaconda3-2019.03-Linux-x86_64.sh
  • ダウンロードしたファイルをbashで実行。以下のようなメッセージが出るので、Enterキーで規約を読み進める。
  $ bash Anaconda3-2019.03-Linux-x86_64.sh
  Welcome to Anaconda3 2019.03
  
    In order to continue the installation process, please review the license
    agreement.
    Please, press ENTER to continue
  • 最後にyesを入力して続行
  cryptography
      A Python library which exposes cryptographic recipes and primitives.
  
  
  Do you accept the license terms? [yes|no]
  [no] >>>yes
  • anacondaのインストール先の指定(デフォルトはEnterを押すだけでユーザーのホームディレクトリ)
    Anaconda3 will now be installed into this location:
    /home/vagrant/anaconda3
    
      - Press ENTER to confirm the location
      - Press CTRL-C to abort the installation
      - Or specify a different location below
    
    [/home/vagrant/anaconda3] >>>
  • 最後にcondaを初期化していいかどうかの確認 yesを入力する。
      installing: conda-build-3.17.6-py37_0 ...
      installation finished.
      Do you wish the installer to initialize Anaconda3
      by running conda init? [yes|no]
      [no] >>>yes
  • 以下のような画面が表示され、完了
      WARNING: The conda.compat module is deprecated and will be removed in a future release.
      no change     /home/vagrant/anaconda3/condabin/conda
      no change     /home/vagrant/anaconda3/bin/conda
      no change     /home/vagrant/anaconda3/bin/conda-env
      no change     /home/vagrant/anaconda3/bin/activate
      no change     /home/vagrant/anaconda3/bin/deactivate
      no change     /home/vagrant/anaconda3/etc/profile.d/conda.sh
      no change     /home/vagrant/anaconda3/etc/fish/conf.d/conda.fish
      no change     /home/vagrant/anaconda3/shell/condabin/Conda.psm1
      no change     /home/vagrant/anaconda3/shell/condabin/conda-hook.ps1
      no change     /home/vagrant/anaconda3/lib/python3.7/site-packages/xonsh/conda.xsh
      no change     /home/vagrant/anaconda3/etc/profile.d/conda.csh
      modified      /home/vagrant/.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 Anaconda3!
      
      ===========================================================================
      
      Anaconda and JetBrains are working together to bring you Anaconda-powered
      environments tightly integrated in the PyCharm IDE.
      
      PyCharm for Anaconda is available at:
      https://www.anaconda.com/pycharm
  • すぐにanacondaを利用できるように
        $ source ~/.bashrc
  • インストールの確認
        $ conda -V
        conda 4.6.11
  • condaの更新(最後にyを入力)
        $ conda update -n base -c defaults conda
  • 自分の環境の構築(最後にyを入力)
        $ conda create --name my_env python=3.6.8
  • 仮想環境の立ち上げ(ターミナルの先頭に(myenv)がつけば完了)
        $ conda activate my_env
        (myenv)
  • proxyの設定 (~/.condarc)に以下を記述
        proxy_servers:
            http: http://[servername]:[port]