Python Forum
Python path not detected even it run in cmd. - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Forum & Off Topic (https://python-forum.io/forum-23.html)
+--- Forum: Bar (https://python-forum.io/forum-27.html)
+--- Thread: Python path not detected even it run in cmd. (/thread-11078.html)



Python path not detected even it run in cmd. - rorjet - Jun-21-2018

Hello everyone,

I would like to ask about Python's Windows environment variables.

I have added python directory to "PYTHON" in user and system variable as follow.
Quote:C:\Users\Rocky\AppData\Local\Programs\Python\Python36\

Also in "Path" of user and system variable.
Quote:%PYTHON%
Quote:C:\Users\Rocky\AppData\Local\Programs\Python\Python36\Scripts\

This is it.
[Image: 2lcprnl.jpg]

And I had rebooted a computer then test to run python command with some script in cmd and
work fine.
[Image: 34ss7id.jpg]
But when I try to install "electron" which is npm package in Node.js programming by command "npm install electron",it required python and it is not detect a python.
Am I miss something?

I find answer for myself and it might be helpful for someone in the future.
There is nothing wrong with path but some Python dependencies may required
Python 2 or 3 so you can install both of them on the same computer as It will not overwrite on each other.
In this case I installed Python 3 first but the electron package which required
node-gyp package which required Python 2 so it is not detected.


RE: Python path not detected even it run in cmd. - snippsat - Jun-21-2018

Add also python folder.
C:\Users\Rocky\AppData\Local\Programs\Python\Python36\
C:\Users\Rocky\AppData\Local\Programs\Python\Python36\Scripts\
I do not at like the long default path Python 36 use on Windows,so have more about that here.
[Image: lwkZgx.jpg]


RE: Python path not detected even it run in cmd. - rorjet - Jun-22-2018

Thank you snippsat !


RE: Python path not detected even it run in cmd. - DeaD_EyE - Jun-22-2018

I don't use Windows much. If I do, only in a VM.
But I like the feature, that you can install applications locally without administrator rights.
Windows is getting closer and closer to Linux.

The good thing is, that the user can make the decision.