To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit 65653333 authored by vermeul's avatar vermeul
Browse files

instructions for pyenv-win added

parent ca6f44f0
......@@ -3,7 +3,7 @@
## Which Python version should I choose?
There is **Python 2.x** (usually 2.5 or 2.7) and there is **Python 3.x** (currently 3.8). Both languages are very similar, but not compatible to each other. If you start a new project, start with a recent version of Python 3, let's say 3.7.
There is **Python 2.x** (usually 2.5 or 2.7) and there is **Python 3.x** (currently 3.9). Both languages are very similar, but not compatible to each other. If you start a new project, start with a recent version of Python 3, let's say 3.7.
Get Python here:
......@@ -24,7 +24,7 @@ The python from your operating system (most likely Python 2.7.x) is usually not
## Know your Python
**use pyenv to install your own Python**
### pyenv to install any Python version
There are way too many ways to install Python, that's why many developers run into an installation mess. **pyenv** is an utility that helps you easily install any Python version you like (from any vendor). Switching between different Python versions becomes extremely easy and happens automatically when you `cd` into a project that uses a specific Python version.
......@@ -38,12 +38,28 @@ $ echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\
$ exec "$SHELL"
```
**pyenv for Windows**
### pyenv for Windows
I haven't tried it out yet, but you might want to look at https://github.com/pyenv-win/pyenv-win
Luckily, pyenv has been ported to Windows! Installation is quite straight forward:
0. install [chocolately](https://chocolatey.org), the package manager for Windows
* search for `PowerShell`
* user right-click to **Run as administrator**
* paste this to install
Install a new Python version:
```
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
```
* or follow the [installation instructions on their website](https://chocolatey.org/install#individual)
1. install pyenv-win
* open PowerShell as admin (see above)
* run `choco install pyenv-win`
2. run pyenv
* open a **cmd** shell
* search for `cmd`
* execute `pyenv` to check that it is properly installed
```
$ pyenv install --list
......@@ -70,7 +86,7 @@ $ pyenv versions
3.3.6
3.4.4
3.5.3
* 3.6.0 (set by /Users/vermeul/.python-version)
* 3.6.9 (set by /Users/vermeul/.python-version)
miniconda3-latest
pypy-5.6.0
```
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment