Intro to Python
Anaconda
最終更新:
introtopython
-
view
目次
現在の仮想環境の情報を一覧表示する
condaコマンドのinfoサブコマンドを使う。
(base) >conda info
active environment : base
active env location : C:\Users\○○○\anaconda3
shell level : 1
user config file : C:\Users\○○○\.condarc
populated config files : C:\Users\○○○\anaconda3\.condarc
C:\Users\○○○\.condarc
conda version : 24.11.3
conda-build version : 24.9.0
python version : 3.12.7.final.0
(以下、表示省略)
Anacondaの仮想環境の一覧を得る
condaコマンドを使う。
>conda env list
# conda environments:
#
base * C:\Users\○○○\anaconda3
すべてのパッケージをアップデートする
updateサブコマンドに--allオプションをつけて実行する。「Proceed ([y]/n)?」で「y」をクリックすると、アップデートが始まる。
(base) >conda update --all
Channels:
- defaults
Platform: win-64
Collecting package metadata (repodata.json): done
Solving environment: done
## Package Plan ##
environment location: C:\Users\○○○\anaconda3
(表示省略)
Proceed ([y]/n)?
Downloading and Extracting Packages:
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
インストールされているパッケージを確認する
condaコマンドのlistサブコマンドは、その仮想環境にインストールされているパッケージを表示する。
(base) >conda list
# packages in environment at C:\Users\○○○\anaconda3:
#
# Name Version Build Channel
_anaconda_depends 2024.10 py312_mkl_0
aiobotocore 2.12.3 py312haa95532_0
aiohappyeyeballs 2.4.0 py312haa95532_0
(以下、表示省略)
大量に表示されるため、コマンドプロンプトであればfindstrコマンドなどとの併用を推奨する。
(base) >conda list | findstr "numpy"
numpy 1.26.4 py312hfd52020_0
numpy-base 1.26.4 py312h4dde369_0
numpydoc 1.7.0 py312haa95532_0