From 66e2530ddd1ff43b78089ed20cac81959dcb0786 Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Sun, 6 Jun 2021 17:24:07 +0800 Subject: [PATCH] [doc] python and virtualenv --- win/setup/python.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 win/setup/python.md diff --git a/win/setup/python.md b/win/setup/python.md new file mode 100644 index 0000000..0a62450 --- /dev/null +++ b/win/setup/python.md @@ -0,0 +1,25 @@ + + +# download and install latest version + +- download from [python for windows](https://www.python.org/downloads/windows/) +- check `Add To Path` path during installation + +# setup pip mirror + +create `$HOME\pip\pip.ini` +```ini +[global] +#index-url = https://pypi.tuna.tsinghua.edu.cn/simple +index-url = https://mirrors.aliyun.com/pypi/simple +``` + + +# alternative versions and virtualenv + +- download alternative versions you need from [python for windows](https://www.python.org/downloads/windows/) (note: not all releases provide binary installer) +- __DO NOT__ check `Add To Path` option during installation +- run `pip install virutalenv` +- run `virtualenv -p $env:LOCALAPPDATA\Programs\Python\PythonXX\python.exe env` to create virtual env for your project +- run `env\Scripts\activate.ps1` on PowerShell to activate the virtualenv +- run `deactivate` when done