LoginSignup
6
3

More than 5 years have passed since last update.

IntelliJ IDEA(PyCharm)でPythonプロジェクトのパッケージの参照解決のメモ

Last updated at Posted at 2017-02-12

IntelliJ(またはPyCharm)でPythonプログラムを開くとデフォルトでは自動でパッケージの参照解決をしてくれません。

screenshot-2017-02-12-123023.png

公式みたのですがちょっとわかりにくかったのでここにまとめます。

  • IntelliJ IDEA 2016.3
  • Python 3.5.2 :: Anaconda custom (x86_64)

メニューのFile > Project Structure or ⌘+; で Project Structure画面を開く。

スクリーンショット 2017-02-12 12.33.39.png

Project SDKのところにSDKがセットされていません。

NewからPython SDKAdd Localを選択。

自分の環境ではAnacondaを利用しているため、下記バスを指定してあげます。

$ which python
/Users/username/anaconda/bin/python

スクリーンショット 2017-02-12 12.37.34.png

SDKをセットできたので、そのままOK

あとはIDEが自動でインデックスを貼ってくれます。

スクリーンショット 2017-02-12 12.40.10.png

参考:
http://stackoverflow.com/questions/24769117/how-do-i-configure-a-python-interpreter-in-intellij-idea-with-the-pycharm-plugin

6
3
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
6
3