[Python] PyCharm - Defining custom recognized import aliases?

Discussão em 'Python' iniciado por Stack, Abril 5, 2025.

  1. Stack

    Stack Membro Participativo

    In PyCharm, I can type np.array, and if I haven't imported NumPy yet, PyCharm gives me a simple click to automatically write the import line. In particular, PyCharm knows that np is referring to numpy and will add the appropriate import numpy as np.

    Is there a way to define my own alias names to be recognized? For example, tensorflow is usually imported as tf. PyCharm doesn't know this by default though, and so doesn't give me the automatic import completion. Any way to do this? Thanks you much!

    Continue reading...

Compartilhe esta Página