PyCharm - Defining custom import aliases?

In PyCharm, I can type np.array , and if I have not imported NumPy yet, PyCharm gives me a simple click to automatically write the import string. In particular, PyCharm knows that np refers to numpy and will add the corresponding import numpy as np .

Is there a way to define my own aliases for recognition? For example, tensorflow usually imported as tf . PyCharm does not know this by default, though, and therefore does not give me automatic import completion. Any way to do this? Thank you very much!

+5
source share

Source: https://habr.com/ru/post/1244763/


All Articles