LoginSignup
9
4

More than 3 years have passed since last update.

Visual Studio Code でpythonの外部ライブラリを自動補完させるようにする

Last updated at Posted at 2020-09-21

Pythonの勉強がてらメモ

vscode でpython を書いていたら、外部ライブラリが補完されず、開発の効率が悪いので
外部ライブラリも補完できるようにしたい。

解決方法

setting.json にライブラリが格納されているパスを記載すればOK

ライブラリのパスを確認

 pip3 install ライブラリ名

インストールされていたら、

Requirement already satisfied: ライブラリ名 in /usr/local/lib/python3.8/site-packages (0.6.3)

のように表示されるはず

このパスに格納されているファイルも一応確認

ls /usr/local/lib/python3.8/site-packages

ライブラリ一覧が表示されたら問題なさそう

setting.json にパスを記載

setting.json を開く

coomand + shit + p

コマンドパレットで、「setting json」 と入力

Open Setting(JSON) を開く

setting.json にパス追加

"python.autoComplete.extraPaths": ["/usr/local/lib/python3.8/site-packages "]

これで保存すれば、外部ライブラリも補完きくし、doc にもジャンプできます。

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