0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

シェルスクリプトでanacondaを起動する方法

Posted at

背景

手動で conda activate [仮想環境名] とコマンドを打てば環境が切り替わるのですが、 バッチ定期実行をしたいと思ってシェルスクリプトに書き込むとできなかったので、解決方法を記述します。

解決方法

conda activate [仮想環境名]の前にanacondaのパッケージにある conda.sh を使います。

source 【workspace】/anaconda3/etc/profile.d/conda.sh
conda activate 【仮想環境名】

PostScript

おそらく.bash_profileを使って、環境パスを追加する方法でもできる、ハズ。

参考にしたリンク

シェルスクリプト内でのconda環境のアクティブ化

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?