2
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にpipインストールする

Last updated at Posted at 2021-06-08

condaとpip

Anaconda はPythonユーザ向けに作られた便利なツールです
今回はAnacondaの基本的なインストールコマンド"conda"ではなく,Pythonの基本的なインストールコマンドの"pip"で環境を作成していきます

対象

・pipが使いたい
・Anacondaを使いたい
・condaとpipが乱立する世界から脱却したい

環境作成

ANACONDA.NAVIGATORを使用します
Environmentsタブを開き,Createボタンを押せば仮想環境の名前とPythonのバージョンを聞かれます
名前,バージョンを入力したら終了です

↓Youtube リンク

今回はpipenvという名前で開始します
image.png

pipインストール

次にHomeからCMD.exe Promptをインストールします
すでにインストールされている場合は,
Applications on pipenv になっていることを確認してください

image.png

インストールが終了したらCMDを起動します
あとは通常のCommand Promptを使ったpipインストールと同様です
環境はすでに選択されているのでactivateは必要ないです
また

pip install -r requirements.txt

でインストールする場合はCMDに表示されているフォルダにインストールしたいrequirements.txtが存在することを確認してください

あとがき

ためしにNumpyをpipでインストールしました
image.png
ちゃんとpipでインストールされたことがアイコンでも表示されています

Anaconda 便利

似ている記事

GUIで仮想環境を作成した記事が見当たらなかったので書きました
下はCMDで作成されています

こぼれ話

なぜかインポートしたはずのパッケージが正しく読み込まれないということも起こっていたのでもう少し原因を探ってみるべきかもしれないです

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