How to let PyCharm automatically find and import dependency?

For example, if I am writing:

 

Agent.run("start")

 

Where 'Agent' has not been imported yet, currently I have to remember where Agent is from and then manually import it. Is it possible that PyCharm automatically find Agent and import the library if desired?

 

1 comment

Hi,

You can place the caret on "Agent", hit "Alt+enter", and select "import this". Not sure how it will work with custom modules, but it works perfectly with installed packages.

0

Please sign in to leave a comment.