Python path - maybe wrong install settings

Hi, I just installed Python on the latest version of Windows as of now.

When I have the path on the Python directory and type the 'Python - - version" it works, but then I type something like “pip install xlwings” and it says the command is not recognized basically.
If I chnage my path to the Python path but add “/scripts” which is where the pip folder is located then the pip commands work but not the “Python - - version” command.
Any insight into this?
I am trying to use excel vba to call a Python function that’s in my desktop. When I run the visual studio ide the code runs but doesn’t seem to return anything.

I assume this is very basic but it’s so frustrating that it doesn’t work.

Thank you

Type that on the DOS command prompt and not on the Python IDLE.

1 Like

This is the expected behavior on Windows. Both the “install directory” and the “script directory” should be added as separate entries on your PATH.

This should have been taken care of for you if you selected the “Add Python to PATH” option when you ran the installer. If that option wasn’t selected, you can always re-run the installer to modify your installation, and enable “Add Python to PATH”. Otherwise, you can add the two directories to your PATH manually.

See the docs section below for more details on installation and PATH setup on Windows.


On Windows, it’s recommended to use the Python Launcher py:

py -m pip install xlwings