Skip to content
Advertisement

Pycharm – how to turn on autocompletion for non-project files?

I have current version of Pycharm Community Edition 2017.2.4 installed on Linux and on Windows.

In the one working on Windows, I open non-project files and while I write code in them, there is autocompletion for in-project modules, classes, etc.

On the Linux (Debian) however, when I write code in non-project file , there is autocompletion only for non-project modules.

Some additional info:

  1. Those in-project modules are installed via PIP on both systems in the same way: pip install -e .
  2. I can run non-project files importing those project modules in both cases.
  3. On Linux I use virtual-env but have set correct project interpreter (as suggested in similar question: Why isn’t PyCharm’s autocomplete working for libraries I install?)

It looks like autocompletion uses system interpreter for those non-project files only. I have loaded several projects and in one of them there is autocompletion for the other.

Advertisement

Answer

Ok, I found out the problem was not with OS.

To turn on autocompletion for non-project files it is needed to add libraries you use to External libraries. Instruction how to do this is in https://stackoverflow.com/a/24206781/4601890

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement