install and import menu item doesn't appear

I am just starting with PyCharm. I wanted to use more_itertools, which is not installed. The video here says I can click on the name and press alt-enter and get a menu that has an install and import option. If I select and press alt-enter, the menu I get just has the options 'Rename reference', 'Ignore unresolved reference', 'Adjust code style settings'. How do I get 'Install and import'?

1 comment
Comment actions Permalink

Hello, 

The import suggestion is in the list if the name of the package in import coincides with the name of the package in the installation command. 

To install the package from your example one should run ``pip install more-itertools``  (with the name provided in https://pypi.org/project/more-itertools/ repository ), however in the code, you would write ``import more_itertools`` (with an underscore "_" instead of "-").  If you would try the same for ``pandas`` package f.e., the option will be available.  Regrettably, there is no option to track all packages and differences between the name in the repository and library import code. 

Let me know if that answers your question. 

0

Please sign in to leave a comment.