Wiki source code of 5 in Windows and Get Pip and Virtualenv
Hide last authors
| author | version | line-number | content |
|---|---|---|---|
| |
2.1 | 1 | {{toc /}} |
| |
1.1 | 2 | |
| |
2.1 | 3 | = Download = |
| |
1.1 | 4 | |
| |
2.1 | 5 | Go to [[url:https://www.python.org/downloads/release/python-365/]]. |
| 6 | |||
| |
1.1 | 7 | Scroll down to the "Files" section. |
| 8 | |||
| 9 | Click on "Windows x86-64 executable installer". Download will start. | ||
| 10 | |||
| 11 | |||
| |
2.1 | 12 | = Install = |
| |
1.1 | 13 | |
| 14 | After download is complete, double click the package. | ||
| 15 | |||
| 16 | Ensure that you tick the checkbox that says "Add Python 3.6 to PATH". Complete the install. | ||
| 17 | |||
| 18 | To test that the installation works, open Command Prompt application and type and press enter: | ||
| 19 | |||
| 20 | {{code}} | ||
| 21 | python3 | ||
| 22 | {{/code}} | ||
| 23 | |||
| 24 | If it shows this then you are OK: | ||
| 25 | |||
| 26 | {{code language="plain"}} | ||
| 27 | Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 05:52:31) | ||
| 28 | [MSC v.1900 64 bit (AMD64)] on win32 | ||
| 29 | Type "help", "copyright", "credits" or "license" for more information. | ||
| 30 | >>> | ||
| 31 | {{/code}} | ||
| 32 | |||
| 33 | Press CTRL-Z and then press enter to exit python3. | ||
| 34 | |||
| 35 | |||
| |
2.1 | 36 | = Install Pip = |
| |
1.1 | 37 | |
| 38 | Open Command Prompt application. | ||
| 39 | |||
| 40 | type this and press enter: | ||
| 41 | |||
| 42 | {{code}} | ||
| 43 | pip3 | ||
| 44 | {{/code}} | ||
| 45 | |||
| 46 | |||
| 47 | If you get the following output you are OK: | ||
| 48 | |||
| 49 | {{code language="plain"}} | ||
| 50 | Usage: | ||
| 51 | pip <command> [options] | ||
| 52 | |||
| 53 | Commands: | ||
| 54 | install Install packages. | ||
| 55 | download Download packages. | ||
| 56 | uninstall Uninstall packages. | ||
| 57 | freeze Output installed packages in requirements format. | ||
| 58 | list List installed packages. | ||
| 59 | show Show information about installed packages. | ||
| 60 | check Verify installed packages have compatible dependencies. | ||
| 61 | search Search PyPI for packages. | ||
| 62 | wheel Build wheels from your requirements. | ||
| 63 | hash Compute hashes of package archives. | ||
| 64 | completion A helper command used for command completion. | ||
| 65 | help Show help for commands. | ||
| 66 | |||
| 67 | General Options: | ||
| 68 | -h, --help Show help. | ||
| 69 | --isolated Run pip in an isolated mode, ignoring environment variables and user configuration. | ||
| 70 | -v, --verbose Give more output. Option is additive, and can be used up to 3 times. | ||
| 71 | -V, --version Show version and exit. | ||
| 72 | -q, --quiet Give less output. Option is additive, and can be used up to 3 times (corresponding to | ||
| 73 | WARNING, ERROR, and CRITICAL logging levels). | ||
| 74 | --log <path> Path to a verbose appending log. | ||
| 75 | --proxy <proxy> Specify a proxy in the form [user:passwd@]proxy.server:port. | ||
| 76 | --retries <retries> Maximum number of retries each connection should attempt (default 5 times). | ||
| 77 | --timeout <sec> Set the socket timeout (default 15 seconds). | ||
| 78 | --exists-action <action> Default action when a path already exists: (s)witch, (i)gnore, (w)ipe, (b)ackup, | ||
| 79 | (a)bort. | ||
| 80 | --trusted-host <hostname> Mark this host as trusted, even though it does not have valid or any HTTPS. | ||
| 81 | --cert <path> Path to alternate CA bundle. | ||
| 82 | --client-cert <path> Path to SSL client certificate, a single file containing the private key and the | ||
| 83 | certificate in PEM format. | ||
| 84 | --cache-dir <dir> Store the cache data in <dir>. | ||
| 85 | --no-cache-dir Disable the cache. | ||
| 86 | --disable-pip-version-check | ||
| 87 | Don't periodically check PyPI to determine whether a new version of pip is available for | ||
| 88 | download. Implied with --no-index. | ||
| 89 | {{/code}} | ||
| 90 | |||
| |
2.1 | 91 | = Install Virtual Env = |
| |
1.1 | 92 | |
| 93 | Open Command Prompt application. | ||
| 94 | |||
| 95 | Type and press enter: | ||
| 96 | |||
| 97 | {{code}} | ||
| 98 | pip3 install virtualenv | ||
| 99 | {{/code}} | ||
| 100 | |||
| 101 | |||
| 102 | It should say something like: | ||
| 103 | |||
| 104 | {{code language="plain"}} | ||
| 105 | Collecting virtualenv | ||
| 106 | Downloading https://files.pythonhosted.org/packages/b6/30/96a02b2287098b23b875bc8c2f58071c35d2efe84f747b64d523721dc2b5/virtualenv-16.0.0-py2.py3-none-any.whl (1.9MB) | ||
| 107 | 100% |████████████████████████████████| 1.9MB 765kB/s | ||
| 108 | Installing collected packages: virtualenv | ||
| 109 | Successfully installed virtualenv-16.0.0 | ||
| 110 | {{/code}} | ||
| 111 | |||
| 112 | To check that it works, type in Command Prompt application and press enter: | ||
| 113 | |||
| 114 | {{code}} | ||
| 115 | virtualenv | ||
| 116 | {{/code}} | ||
| 117 | |||
| 118 | |||
| 119 | If it shows the following, you are OK. | ||
| 120 | |||
| 121 | {{code language="plain"}} | ||
| 122 | You must provide a DEST_DIR | ||
| 123 | Usage: virtualenv [OPTIONS] DEST_DIR | ||
| 124 | |||
| 125 | Options: | ||
| 126 | --version show program's version number and exit | ||
| 127 | -h, --help show this help message and exit | ||
| 128 | -v, --verbose Increase verbosity. | ||
| 129 | -q, --quiet Decrease verbosity. | ||
| 130 | -p PYTHON_EXE, --python=PYTHON_EXE | ||
| 131 | The Python interpreter to use, e.g., | ||
| 132 | --python=python3.5 will use the python3.5 interpreter | ||
| 133 | to create the new environment. The default is the | ||
| 134 | interpreter that virtualenv was installed with (/Libra | ||
| 135 | ry/Frameworks/Python.framework/Versions/3.6/bin/python | ||
| 136 | 3.6) | ||
| 137 | --clear Clear out the non-root install and start from scratch. | ||
| 138 | --no-site-packages DEPRECATED. Retained only for backward compatibility. | ||
| 139 | Not having access to global site-packages is now the | ||
| 140 | default behavior. | ||
| 141 | --system-site-packages | ||
| 142 | Give the virtual environment access to the global | ||
| 143 | site-packages. | ||
| 144 | --always-copy Always copy files rather than symlinking. | ||
| 145 | --relocatable Make an EXISTING virtualenv environment relocatable. | ||
| 146 | This fixes up scripts and makes all .pth files | ||
| 147 | relative. | ||
| 148 | --no-setuptools Do not install setuptools in the new virtualenv. | ||
| 149 | --no-pip Do not install pip in the new virtualenv. | ||
| 150 | --no-wheel Do not install wheel in the new virtualenv. | ||
| 151 | --extra-search-dir=DIR | ||
| 152 | Directory to look for setuptools/pip distributions in. | ||
| 153 | This option can be used multiple times. | ||
| 154 | --download Download preinstalled packages from PyPI. | ||
| 155 | --no-download, --never-download | ||
| 156 | Do not download preinstalled packages from PyPI. | ||
| 157 | --prompt=PROMPT Provides an alternative prompt prefix for this | ||
| 158 | environment. | ||
| 159 | --setuptools DEPRECATED. Retained only for backward compatibility. | ||
| 160 | This option has no effect. | ||
| 161 | --distribute DEPRECATED. Retained only for backward compatibility. | ||
| 162 | This option has no effect. | ||
| 163 | --unzip-setuptools DEPRECATED. Retained only for backward compatibility. | ||
| 164 | This option has no effect. | ||
| 165 | {{/code}} |