One, under Windows installation 1.1 python download
[python下载]( https://www.python.org/downloads/)
选择可执行文件( 64位3.5.2Windows x86-64 executable installer或32位3.5.2 Windows x86 executable installer)、
( 64-bit 2.7.12 Windows x86-64 MSI installer or 32-bit 2.7 .12 Windows x86 MSI installer)
1.2Python installation (includes Python2 and Python3)
推荐安装路径为C:\Python27和C:\Python35,因为如果路径有空格的话(C:\Program Files\Python35)pip可能会有问题.
将C:\Python35\python.exe修改为python3.exe,C:\Python35\Scripts\pip.exe改为pip3.exe,如果已经有pip3.exe,就把pip.exe删除。
以后需要使用Python3的环境就在终端输入python3就行(输入python就是python2.7的环境),同理pip3就是使用python3的pip
上面改好之后pip可能会出问题(终端输入>pip3 报错如下:Fatal error in launcher: Unable to create process using ‘"‘),需要升级一下对应的pip3(终端输入>python3 -m pip install -U pip)
1.3 about Pip
With regard to pip, Python, similar to previous versions of Yum, may also have a single pip, and Python now comes with Pip, without having to install the PIP separately.
1.4 Configuring Environment variables
" right-click Computer "-< Span class= "hljs-literal" >-- - "Advanced system settings" - --- "Environment variable" -- "found in the second content box - -> "Python installation directory appended to the variable value, /span>
II. Install Python under Linux
无需安装,原装Python环境. ps:如果自带2.6,请更新至2.7
Third, upgrade Python under Windows
Unloading load can be.
Iv. updating Python under Linux
Linux Yum relies on its own python, to prevent errors, the update here is actually to install a python.
1 View the default Python version2Python-V3 4 1, installing GCC for compiling python source code5 Yum Install GCC6 2, download source package, https://www.python.org/ftp/python/7 3, unzip and enter the source file8 4, compiling and installing9./ConfigureTen Make All One Make Install A 5, view version -/usr/local/bin/python2.7-V - 6, modify the default Python version the MV/usr/bin/python/usr/bin/python2.6 - LN-s/usr/local/bin/python2.7/usr/bin/python - 7, prevent Yum from executing exceptions, and modify the Python version used by Yum - VI/usr/bin/Yum +Change the head #!/usr/bin/python to #!/usr/bin/python2.6
001-python basic-python installation and upgrade