LoginSignup
12
9

More than 3 years have passed since last update.

Git BashでAnaconda, Pythonインタプリタを使う

Last updated at Posted at 2019-08-24

はじめに

Windowsのコマンドプロンプトが使いにくいのは周知のとおり。Gitを導入したらGit Bashというものが使えるようになる。grep等、linuxの便利なコマンドも使える。というわけで、早速このGit bash上でAnaconda, Pythonインタプリタを使えるようにしたので、メモしておく。

環境

  • Windows10
  • git 2.23.0.windows.1
  • git-gui 0.21
  • Anaconda3

方法

ホームディレクトリに、以下の.profileファイルを置いておきGit Bashを起動すればよい。通常はC:\Users\<ユーザ名>にフォルダになっていると思われる。わからなければGit Bash上で、echo $HOME 等で確認できる。

. /c/ProgramData/Anaconda3/etc/profile.d/conda.sh
alias python='winpty python.exe'

なお、1行目は、自身のAnacondaの環境に読み替えてください。

注意点

上記によってcondaコマンドは使えるようになるが、activate.batにはパスが通っていないため、activateは conda activate <仮想環境名> のように実行する必要がある。

12
9
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
12
9