I am using PyCharm community edition 2018.3.1 under Windows 10.
Essential is also that Python is not installed, so there are no default paths pointing to Python or Python/Scripts in my system path. So I am relying on PyCharm's search path.
After adding a directory to the interpreters search path via:
File -> settings -> Project Interpreter then selecting "show all" and then selecting the icon and adding "Python3.6.6\Scritps" in order to extend the PATH variable so that the executables under Scripts can be found, like pip and sphinx-build.
I see added to the list:
however, pip and other executables are not found when using os.system("pip")
When I add that path to my general search path before calling PyCharm, os.system("pip") is found,
When I don't add that path to my general search path before launching PyCharm, os.system("pip") can't find pip.
In both cases above, I see Python3.6.6/Scripts in sys.path.
So the path used in "os.system" is not described by sys.path
What I also notice is that when using venv, this problem doesn't exsit because pip, sphinx-build are all in the Scripts directory together with Python. So when not using venv, Scripts is not a part of the "standard search" paths.
I suspect that this problem is not often seen, because most people are using a single Python install. But because I need to use several different Python runtimes, Like version 3.6 and 3.7 and even 64 and 32 bit releases in different projects, I can't have single global python install. So when using PyCharm, I have to rely on its search paths. When I call those same python modules in my own batch files, they work, because I set the correct enviromental varaibles before calling them. But if I launch PyCharm "globally" and not with a batch file, PyCharm only sees my default enviromental variables, which does not include any reference to any python runtime, so I must rely on the paths configured in the Pycharm tool.
So I hope that you can reproduce this issue point out what I may be seeing or doing incorrectly.