Anaconda

作成日 : 2011-06-12
最終更新日 :

WSL の Anaconda

インストール

Windows Subsystem on Linux の Ubuntu 20.04 LTS に Anaconda を入れた。
https://linuxize.com/post/how-to-install-anaconda-on-ubuntu-20-04/

$ wget -P /tmp https://repo.anaconda.com/archive/Anaconda3-2020.07-Linux-x86_64.sh


これには私の環境で 2 分 42 秒かかった。

$ sha256sum /tmp/Anaconda3-2020.07-Linux-x86_64.sh
38ce717758b95b3bd0b1797cc6ccfb76f29a90c25bdfa50ee45f11e583edfdbf /tmp/Anaconda3-2020.07-Linux-x86_64.sh
この値と、次のサイトの sha256 の欄と比較する。 一致していれば正しくダウンロードできていることの証明になる。
https://docs.anaconda.com/anaconda/install/hashes/Anaconda3-2020.07-Linux-x86_64.sh-hash/
一致している。

  $ bash /tmp/Anaconda3-2020.02-Linux-x86_64.sh
  	
  Welcome to Anaconda3 2020.07
  
  In order to continue the installation process, please review the license agreement.
  Please, press ENTER to continue
  >>>
  (中略)
  Do you approve the license terms? [yes|no]
  [no] >>>
  

キー入力で yes として Enter キーを押す。

  Anaconda3 will now be installed into this location:
  /home/username/anaconda3
  	
    - Press ENTER to confirm the location
    - Press CTRL-C to abort the installation
    - Or specify a different location below
  
  [/home/username/anaconda3] >>>
  

このまま Enter キーを押す。

  PREFIX=/home/username/anaconda3
  Unpacking payload ...
  

上の画面が出てくるが、その後は多少時間がかかる。次の画面が出てくるので、yes を入力し、 Enter キーを押す。

  (中略)
  Installation finished.
  Do you wish the installer to initialize Anaconda3
  by running conda init? [yes|no]
  [no]>>>

ここは yes を入力する。これでいったん終わる。 その後、次のコマンドを実行して、新しい環境の初期化を行う。

$ source ~/.bashrc

次のコマンドで、所望のパッケージがインストールされているか、 指定のバージョンより新しいものかを確認する。必要に応じて grep するのもよい。

$ conda list

Windows の Anaconda

アンインストールとインストール

2025-03-05 、今まで Anaconda を入れていたのだがそろそろアップデートをしなければと思って試みたのだが、全然更新されない。しかたなく、すべてアンインストールして、再度最新版を入れ直した。 Anaconda3-2024.10-1-Windows-x86_64.exe である。

jpegtran

Anaconda を入れると、 JPEG の画像変換ができるコマンド jpegtran がもれなくついてくる。 jpegtran は、カラー画像からグレースケール画像への変換が可能である。 Windows のシェルからは次のような使い方が表示される。

    C> jpegtran
    C:\Users\username\Anaconda3\Library\bin\jpegtran.exe: must name one input and one output file
    usage: C:\Users\username\Anaconda3\Library\bin\jpegtran.exe [switches] inputfile outputfile
    Switches (names may be abbreviated):
      -copy none     Copy no extra markers from source file
      -copy comments Copy only comment markers (default)
      -copy all      Copy all extra markers
      -optimize      Optimize Huffman table (smaller file, but slow compression)
      -progressive   Create progressive JPEG file
    Switches for modifying the image:
      -crop WxH+X+Y  Crop to a rectangular subarea
      -flip [horizontal|vertical]  Mirror image (left-right or top-bottom)
      -grayscale     Reduce to grayscale (omit color data)
      -perfect       Fail if there is non-transformable edge blocks
      -rotate [90|180|270]         Rotate image (degrees clockwise)
      -scale M/N     Scale output image by fraction M/N, eg, 1/8
      -transpose     Transpose image
      -transverse    Transverse transpose image
      -trim          Drop non-transformable edge blocks
      -wipe WxH+X+Y  Wipe (gray out) a rectangular subarea
    Switches for advanced users:
      -arithmetic    Use arithmetic coding
      -restart N     Set restart interval in rows, or in blocks with B
      -maxmemory N   Maximum memory to use (in kbytes)
      -outfile name  Specify name for output file
      -verbose  or  -debug   Emit debug output
    Switches for wizards:
      -scans file    Create multi-scan JPEG per script file
    

tensorflow

tensorflow を導入することにした。うまくできるだろうか。

C:\Users\Username> conda install tensorflow
Channels:
- defaults
Platform: win-64
Collecting package metadata (repodata.json): done
Solving environment: | warning libmamba Added empty dependency for problem type SOLVER_RULE_UPDATE
failed

LibMambaUnsatisfiableError: Encountered problems while solving:
- nothing provides bleach 1.5.0 needed by tensorboard-1.7.0-py35he025d50_1

Could not solve for environment specs
The following packages are incompatible
├─ pin-1 is installable and it requires
│ └─ python 3.12.* , which can be installed;
└─ tensorflow is not installable because there are no viable options
  ├─ tensorflow [1.10.0|1.9.0] would require
  │ └─ python 3.5.* , which conflicts with any installable versions previously reported;
  ├─ tensorflow [1.10.0|1.11.0|...|2.1.0] would require
  │ └─ python 3.6.* , which conflicts with any installable versions previously reported;
  ├─ tensorflow [1.13.1|1.14.0|...|2.9.1] would require
  │ └─ python 3.7.* , which conflicts with any installable versions previously reported;
  ├─ tensorflow [1.7.0|1.7.1|1.8.0] would require
  │ └─ tensorboard [>=1.7.0,<1.8.0 |>=1.8.0,<1.9.0 ], which requires 
  │   └─ bleach 1.5.0 , which does not exist (perhaps a missing channel);
  ├─ tensorflow [2.10.0|2.8.2|2.9.1] would require        
  │ └─ python 3.10.* , which conflicts with any installable versions previously reported; 
  ├─ tensorflow [2.10.0|2.3.0|...|2.9.1] would require 
  │ └─ python 3.8.* ,    which conflicts with any installable versions previously reported; 
  └─ tensorflow [2.10.0|2.5.0|2.6.0|2.8.2|2.9.1]    would require 
      └─ python 3.9.* , which conflicts with any installable versions previously reported.
  
 C:\Users\Username

tensorflow の導入はあきらめた。ついでに、Anaconda はやはり大きすぎるので Miniforge にしてやりなおそうと思う。

CuPy

CuPy の導入を参照。

まりんきょ学問所Python の開墾 > Anaconda


MARUYAMA Satosi