LoginSignup
4
5

More than 5 years have passed since last update.

virtualenvやcondaで作成した仮想環境をIntelliJ IDEA(PyCharm)のプロジェクトに反映させる(メモ)

Last updated at Posted at 2017-08-05

問題:仮想環境でインストールしたパッケージの参照が取れない

Kobito.kTIjwv.png

解決

command + ; にて、Project Structureを開き、左上の+からPython SDK > Add Localを選択

Kobito.ykUxyG.png

仮想環境のbin/pythonのパスを設定。
私の環境だと /Users/user_name/anaconda/envs/machine_learning_env/bin/python

Kobito.JGuG84.png

追加後、applyにてパスを解決できるようになる。

うまくいかないときは、.idea/のディレクトリごと削除して、プロジェクトを作り直すのが早い(かも)

参考:https://www.jetbrains.com/help/idea/adding-existing-virtual-environment.html

4
5
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
4
5