환경 변수 수동 설정:
Owner 라는 계정의 윈도우10,11에서
- Python이 이미 설치되어 있고, 재설치 없이 pip의 경로를 수동으로 환경 변수에 추가하려면, Python 설치 디렉터리 내의 Scripts 폴더 경로를 환경 변수에 추가해야 합니다. 예를 들어, Python이 C:\Users\Owner\AppData\Local\Programs\Python\Python311\에 설치되어 있다면, 다음 경로를 시스템의 환경 변수 Path에 추가해야 합니다:
- C:\Users\Owner\AppData\Local\Programs\Python\Python311\
- C:\Users\Owner\AppData\Local\Programs\Python\Python311\Scripts\
-
-
#이것은 주석입니다.
# 사용법
$NewPath = [System.Environment]::GetEnvironmentVariable("PATH", "Machine") + ";C:\MyNewPath"
[System.Environment]::SetEnvironmentVariable("PATH", $NewPath, "Machine")
# 사용법2 python311경로에 추가1
$Path = [System.Environment]::GetEnvironmentVariable("Path", [System.EnvironmentVariableTarget]::Machine)
$PythonPath = "C:\Users\Owner\AppData\Local\Programs\Python\Python311"
$NewPath = $Path + ";" + $PythonPath
[System.Environment]::SetEnvironmentVariable("Path", $NewPath, [System.EnvironmentVariableTarget]::Machine)
# 사용법2 python311경로에 추가2 ( 이것도 해줘야 한다. )
$Path = [System.Environment]::GetEnvironmentVariable("Path", [System.EnvironmentVariableTarget]::Machine)
$PythonPath = "C:\Users\Owner\AppData\Local\Programs\Python\Python311\Scripts"
$NewPath = $Path + ";" + $PythonPath
[System.Environment]::SetEnvironmentVariable("Path", $NewPath, [System.EnvironmentVariableTarget]::Machine)