1
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 3 years have passed since last update.

Anacondaでのpython2.x系環境への切り替え

Last updated at Posted at 2021-06-13

はじめに

初学者向けにPython2.x系環境の作り方と切り替え方を手短に説明していきます.

python2.x系環境の作成

ここではpython2.7の環境を構築することとします.
Anaconda Promptにて以下のコマンドを実行します.

$ conda create -n py27 python=2.7 anaconda

環境名は任意であり,今回はpy27という文字列にしました.
pythonのバージョンも任意に変更できます.

生成したpython2.x系環境への切り替え

Anaconda Promptにて以下のコマンドを実行します.

$ conda activate py27

以上で切り替え完了です.Anaconda Promptの(base)が(py27)に変化していれば成功です.

元の環境(python3.x)に戻すには,

$ conda deactivate

を実行します.

参考文献

  • K-Lab Anacondaを用いたPython 2.x系と3.x系の使い分け

1
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
1
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?