1
0

More than 3 years have passed since last update.

atomのautocomplete-pythonが動かなかった時の対処法メモ

Posted at

atomを使ってpythonの環境構築をしていたときに、packegeのautocomplete-pythonがうまく動かず、
調べてもパッと出てこなかったのでとりあえず日本語で残しておこうと思います。

内容はここに書いてあることと同じ。
https://stackoverflow.com/questions/44602603/atom-ide-autocomplete-python-not-working/52023811#52023811?newreg=45250004097448b89124410714d158d6

前提

OS:macOS Catalina 10.15.5
pythonバージョン:3.8.5
atom:1.49.0x64
autocomplete-python:1.16.0

起こったこと

期待していた状態

autocomplete-pythonが正しく動作していれば、
例えばpythonファイルを開いて「i」と打った時に下の画像のような感じでpythonのキーワードが候補として出てきます。
image.png

現実

ただ、実際は下の画像のように、autocomplete-plusしか動作していませんでした。
image.png

解決方法

~/.atom/packages/autocomplete-python/lib/jedi/parser
配下に、使用しているpythonのバージョンと同じバージョンのgrammar3.x.txtが存在していないとだめなようです。
自分はpython3.8を利用していたので、grammar3.8.txtがないとダメなんですが、確認してみるとgrammar3.7.txtまでしかありませんでした。

ということで、grammar3.7.txtをコピーして、grammar3.8.txtを作ってあげれば無事動くようになりました。

参考:https://stackoverflow.com/questions/44602603/atom-ide-autocomplete-python-not-working/52023811#52023811?newreg=45250004097448b89124410714d158d6

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