Installing Python 3 on Windows

https://d33wubrfki0l68.cloudfront.net/02962eb19c0069740d16e67b5ba7c613238c8b9a/30ed2/_images/34435689480_2e6f358510_k_d.jpg
First, follow the installation instructions for Chocolatey.It’s a community system packager manager for Windows 7+. (It’s very much like Homebrew on OS X.)

Once done, installing Python 3 is very simple, because Chocolatey pushes Python 3 as the default.

  1. choco install python

Once you’ve run this command, you should be able to launch Python directly from to the console.(Chocolatey is fantastic and automatically adds Python to your path.)

Setuptools + Pip

The two most crucial third-party Python packages are setuptools and pip,which let you download, install and uninstall any compliant Python softwareproduct with a single command. It also enables you to add this network installationcapability to your own Python software with very little work.

All supported versions of Python 3 include pip, so just make sure it’s up to date:

  1. python -m pip install -U pip

Pipenv & Virtual Environments

The next step is to install Pipenv, so you can install dependencies and manage virtual environments.

A Virtual Environment is a tool to keep the dependencies required by different projectsin separate places, by creating virtual Python environments for them. It solves the“Project X depends on version 1.x but, Project Y needs 4.x” dilemma, and keepsyour global site-packages directory clean and manageable.

For example, you can work on a project which requires Django 2.0 while alsomaintaining a project which requires Django 1.8.

So, onward! To the Pipenv & Virtual Environments docs!


This page is a remixed version of another guide,which is available under the same license.

原文: https://docs.python-guide.org/starting/install3/win/