Reputation: 5273
When I import a module such as numpy
by typing import numpy as np
, and then start typing np.
... Pycharm auto-completes the code and shows suggestions.
But when I import a custom module that I built (import my_module as md
), typing md.
... doesn't show up the inner attributes of the module (although completing the code manually works and runs successfully). How can this be achieved?
Upvotes: 3
Views: 2152
Reputation: 23554
You need to mark(Mark Directory as) folder with your package as Sources Root.
Steps:
Right click on folder -> Mark Directory as -> Sources Root
UPD: Also if folder does presented in project scope, open Preferences -> Project -> Project Structure -> Add Content Root -> And mark folder containing your module as Sources
Upvotes: 7