Skip to content

Instantly share code, notes, and snippets.

@Ivoz
Created July 20, 2020 04:49
Show Gist options
  • Save Ivoz/13bce40b7b9aeb6e72e8aa5ab52f93bc to your computer and use it in GitHub Desktop.
Save Ivoz/13bce40b7b9aeb6e72e8aa5ab52f93bc to your computer and use it in GitHub Desktop.
If you are able to run python code, use this to add python to your path on windows
import sys
from pathlib import Path
# Get the path to the Scripts directory
scripts_path = Path(sys.base_prefix) / "Tools" / "Scripts"
# Append it to python's import path so we can grab it
sys.path.append(str(scripts_path))
# Import the main function from the win_add2path script
from win_add2path import main
# run the main function to add python to out path
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment