Installing python module into Intellij generates path related error

For a python module that was installed via pip on command line Intellij still asked for it to be installed inside the IDE.

I clicked on Install and it proceeded - but the following error was generated:

enter image description here

That error had previously been generated on the command line when the PYTHONPATH env variable were set. It needed to be explicitly unset and then the pip install worked.

The interesting twist here is that the package ( sklearn in this case) seems to have been mostly installed correctly: the imports are now mostly recgonized:

enter image description here

Also the Intellisense works - specifically the ability to click into the module contents:

enter image description here

There may not be any "hard" problem here - but in any case it would be useful to know how to avoid the errors.error.