Why do I have to write in the system environment variable when I pass the Python path?

Asked 1 years ago, Updated 1 years ago, 308 views

I would appreciate it if you could feel free to point out the following points where the terminology is used incorrectly or the content is difficult to understand.
Please give us your frank opinion for future studies.

  • OS:Windows 10

If the python command is not available in Python tutorials, the cause and solution is often written in PATH of the system environment variable. Why is it not PATH of the user environment variable

?

When I registered with the user environment variable PATH, it didn't work, and when I checked eho%PATH% at the command prompt, I found that I didn't see what I should have registered with the user environment variable PATH.

I guess the possible reasons for the above question are one of the following, but I would like to ask you a question because I cannot get to the information that clearly states the reason.

  • python only goes to see system environment variables
  • python goes to see PATH (system environment variable generated according to i.e.OS rules + user environment variable), but PATH should not reflect the contents of the user environment variable.
    In order to pass paths such as the
  • python command, you must register the path of the directory containing python.exe and so on with the environment variable PATH
  • The prompt must be restarted to reflect updates to environment variables at the Windows command prompt
  • If you are using a command prompt with normal privileges (not administrator privileges), the user environment variable takes precedence except for the environment variable PATH
  • If you are using the command prompt with normal privileges (not administrator privileges), the environment variable PATH is set as the system environment variable + user environment variable, and if there are duplicates, it takes precedence (i.e. system environment variable).

python windows

2023-01-16 01:11

1 Answers

Question Python
in Python tutorials, etc. If the command is not available, the common cause and solution is to register the system environment variable with PATH, but why the user environment variable
Isn't it PATH?

Either the system environment variable or the user environment variable is fine.

The system environment variable is valid for all users, but the user environment variable is valid only for certain users.
*The person who asked the question doesn't know what the page you referred to is, but it should not be written as a user environment variable or a system environment variable.

When I registered with PATH of the user environment variable, it didn't work, and when I checked eho%PATH% at the command prompt, it didn't show what I should have registered with PATH of the user environment variable.

After setting the environment variable, you should be able to check it by launching a new command prompt.Command Prompts that have already been launched do not reflect new and changed environment variables.

<eho%PATH% is a mistake of echo%PATH%.

Understanding the Questioner

  • In order to pass a path such as the python command, you must register the path of the directory containing python.exe with the environment variable PATH.

Yes, it's the same as my understanding.

  • The prompt must be restarted to reflect updates to environment variables at the Windows command prompt

Yes, I need it.It cannot be reflected in programs that started before changing environment variables.

  • If you are using a command prompt with normal privileges (not administrator privileges), the user environment variable takes precedence except for the environment variable PATH.

No, the difference between the system and user environment variables is the difference between being enabled for all users and being enabled only for users when configured.

  • Environment variable PATH is set as system environment variable + user environment variable when using the command prompt with normal privileges (not administrator privileges) and priority is given to duplicate content (i.e.> system environment variable).

No, I think the presence or absence of administrative authority has nothing to do with this issue.
Paths of system and user environment variables were preferred as registered system environment variables.

Additional information

The maximum length that can be defined for an environment variable is determined, and if the system environment variable is too long, the user environment variable may be truncated.


2023-01-16 03:48

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.