Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <strong>UPDATE</strong>: 2018-07-06 <p>This post is now nearly 5 years old! <a href="https://www.python.org/dev/peps/pep-0373/" rel="nofollow noreferrer">Python-2.7 will stop receiving official updates from python.org in 2020</a>. Also, <a href="https://www.python.org/downloads/release/python-370/" rel="nofollow noreferrer">Python-3.7 has been released</a>. Check out <a href="http://python-future.org/" rel="nofollow noreferrer">Python-Future</a> on how to make your Python-2 code compatible with Python-3. For updating conda, the documentation now recommends using <code>conda update --all</code> in each of your conda environments to update all packages and the Python executable for that version. Also, since they changed their name to Anaconda, I don't know if the Windows registry keys are still the same.</p> <strong>UPDATE</strong>: 2017-03-24 <p>There have been no updates to Python(x,y) since June of 2015, so I think it's safe to assume it has been abandoned.</p> <strong>UPDATE</strong>: 2016-11-11 <p>As <a href="https://stackoverflow.com/questions/15102943/how-to-update-python/17954487#comment68062745_17954487">@cxw comments below</a>, these answers are for the same bit-versions, and by bit-version I mean 64-bit vs. 32-bit. For example, these answers would apply to updating from 64-bit Python-2.7.10 to 64-bit Python-2.7.11, <em>ie</em>: the <strong>same</strong> bit-version. While it is possible to install two different bit versions of Python together, it would require some hacking, so I'll save that exercise for the reader. If you don't want to hack, I suggest that if switching bit-versions, remove the other bit-version first.</p> <strong>UPDATES</strong>: 2016-05-16 <ul> <li><a href="https://docs.continuum.io/anaconda/install#windows-install" rel="nofollow noreferrer">Anaconda</a> and <a href="http://conda.pydata.org/docs/install/quick.html#windows-miniconda-install" rel="nofollow noreferrer">MiniConda</a> can be used with an existing Python installation by disabling the options to alter the Windows <code>PATH</code> and Registry. After extraction, create a symlink to <code>conda</code> in your <code>bin</code> or install conda from PyPI. Then create another symlink called <code>conda-activate</code> to <code>activate</code> in the Anaconda/Miniconda root bin folder. Now Anaconda/Miniconda is just like Ruby RVM. Just use <code>conda-activate root</code> to enable Anaconda/Miniconda.</li> <li>Portable Python is no longer being developed or maintained.</li> </ul> <h1>TL;DR</h1> <ul> <li>Using <a href="https://www.anaconda.com/download/" rel="nofollow noreferrer">Anaconda or miniconda</a>, then just execute <code>conda update --all</code> to keep each conda environment updated,</li> <li><strong>same <em>major</em> version of <a href="https://www.python.org/" rel="nofollow noreferrer">official Python</a></strong> (<em>e.g.</em> 2.7.5), just install over old (<em>e.g.</em> 2.7.4), </li> <li><strong>different <em>major</em> version of <a href="https://www.python.org/" rel="nofollow noreferrer">official Python</a></strong> (<em>e.g.</em> 3.3), install side-by-side with old, set paths/associations to point to dominant (<em>e.g.</em> 2.7), shortcut to other (<em>e.g.</em> in BASH <code>$ ln /c/Python33/python.exe python3</code>).</li> </ul> <h3>The answer depends:</h3> <ol> <li><p>If OP has 2.7.x and wants to install newer version of 2.7.x, then</p> <ul> <li>if using <a href="http://en.wikipedia.org/wiki/Windows_Installer" rel="nofollow noreferrer">MSI installer</a> from the <a href="http://www.python.org/download/" rel="nofollow noreferrer">official Python website</a>, just install over old version, installer will issue warning that it will remove and replace the older version; looking in "installed programs" in "control panel" before and after confirms that the old version has been replaced by the new version; newer versions of 2.7.x are backwards compatible so this is completely safe and therefore IMHO multiple versions of 2.7.x should never necessary.</li> <li>if building from source, then you should probably build in a fresh, clean directory, and then point your path to the new build once it passes all tests and you are confident that it has been built successfully, but you may wish to keep the old build around because building from source may occasionally have issues. See my <a href="http://poquitopicante.blogspot.com/2015/03/building-python-x64-on-windows-7-with.html" rel="nofollow noreferrer">guide for building Python x64 on Windows 7 with SDK 7.0</a>.</li> <li>if installing from a distribution such as <a href="https://code.google.com/p/pythonxy/" rel="nofollow noreferrer">Python(x,y)</a>, see their website. <strong><a href="http://python-xy.github.io/" rel="nofollow noreferrer">Python(x,y)</a> has been abandoned.</strong> <s>I believe that updates can be handled from within Python(x,y) with their package manager, but <a href="https://code.google.com/p/pythonxy/wiki/Downloads#Updates" rel="nofollow noreferrer">updates are also included on their website</a>. I could not find a specific reference so perhaps someone else can speak to this. Similar to ActiveState and probably Enthought, Python (x,y) clearly states it is incompatible with other installations of Python:</s> <blockquote> <p>It is recommended to uninstall any other Python distribution before installing Python(x,y) </p> </blockquote></li> <li><a href="https://www.enthought.com/downloads/" rel="nofollow noreferrer">Enthought Canopy</a> uses an MSI and will install either into <code>Program Files\Enthought</code> or <code>home\AppData\Local\Enthought\Canopy\App</code> for all users or per user respectively. Newer installations are updated by using the built in update tool. See their <a href="http://docs.enthought.com/canopy/quick-start/install_windows.html" rel="nofollow noreferrer">documentation</a>.</li> <li><a href="http://www.activestate.com/activepython/downloads" rel="nofollow noreferrer">ActiveState</a> also uses an MSI so newer installations can be installed on top of older ones. See their <a href="http://docs.activestate.com/activepython/2.7/installnotes.html#msi" rel="nofollow noreferrer">installation notes</a>. <blockquote> <p>Other Python 2.7 Installations On Windows, ActivePython 2.7 cannot coexist with other Python 2.7 installations (for example, a Python 2.7 build from python.org). Uninstall any other Python 2.7 installations before installing ActivePython 2.7.</p> </blockquote></li> <li><a href="http://www.sagemath.org/download-windows.html" rel="nofollow noreferrer">Sage</a> recommends that you install it into a virtual machine, and provides a Oracle VirtualBox image file that can be used for this purpose. Upgrades are handled internally by issuing the <code>sage -upgrade</code> command.</li> <li><p><a href="https://store.continuum.io/cshop/anaconda/" rel="nofollow noreferrer">Anaconda</a> can be <a href="http://docs.continuum.io/anaconda/install.html#updating-from-older-anaconda-versions" rel="nofollow noreferrer">updated by using the <code>conda</code> command</a>:</p> <pre><code>conda update --all </code></pre> <p>Anaconda/Miniconda lets users create <em>environments</em> to manage multiple Python versions including Python-2.6, 2.7, 3.3, 3.4 and 3.5. The root Anaconda/Miniconda installations are currently based on either Python-2.7 or Python-3.5.</p> <p><s>Anaconda will likely disrupt any other Python installations. Installation uses MSI installer.</s> [<strong>UPDATE</strong>: 2016-05-16] <em>Anaconda and Miniconda now use <code>.exe</code> installers and provide options to disable Windows <code>PATH</code> and Registry alterations.</em></p> <p>Therefore Anaconda/Miniconda can be installed without disrupting existing Python installations depending on how it was installed and the options that were selected during installation. If the <code>.exe</code> installer is used and the options to alter Windows <code>PATH</code> and Registry are <em>not</em> disabled, then any previous Python installations <em>will be disabled</em>, but simply uninstalling the Anaconda/Miniconda installation should restore the original Python installation, except maybe the Windows Registry <code>Python\PythonCore</code> keys.</p> <p>Anaconda/Miniconda makes the following registry edits regardless of the installation options: <code>HKCU\Software\Python\ContinuumAnalytics\</code> with the following keys: <code>Help</code>, <code>InstallPath</code>, <code>Modules</code> and <code>PythonPath</code> - official Python registers these keys too, but under <code>Python\PythonCore</code>. Also uninstallation info is registered for Anaconda\Miniconda. Unless you select the "Register with Windows" option during installation, it doesn't create <code>PythonCore</code>, so integrations like Python Tools for Visual Studio do not automatically see Anaconda/Miniconda. If the option to register Anaconda/Miniconda <em>is</em> enabled, then I think your existing Python Windows Registry keys will be altered and uninstallation will probably not restore them.</p></li> <li><a href="https://winpython.github.io/" rel="nofollow noreferrer">WinPython</a> updates, I think, can be handled through the <a href="https://github.com/winpython/winpython/wiki/Winpython-Control-Panel" rel="nofollow noreferrer">WinPython Control Panel</a>.</li> <li><a href="http://portablepython.com/" rel="nofollow noreferrer">PortablePython</a> is <strong>no longer being developed</strong>. <s>It had no update method. Possibly updates could be unzipped into a fresh directory and then <code>App\lib\site-packages</code> and <code>App\Scripts</code> could be copied to the new installation, but if this didn't work then reinstalling all packages might have been necessary. Use <code>pip list</code> to see what packages were installed and their versions. Some were installed by PortablePython. Use <code>easy_install pip</code> to install pip if it wasn't installed.</s></li> </ul></li> <li><p>If OP has 2.7.x and wants to install a different version, <em>e.g.</em> &lt;=2.6.x or >=3.x.x, then installing different versions side-by-side is fine. You must choose which version of Python (if any) to associate with <code>*.py</code> files and which you want on your path, although you should be able to set up shells with different paths if you use <a href="http://tiswww.case.edu/php/chet/bash/bashtop.html" rel="nofollow noreferrer">BASH</a>. AFAIK 2.7.x is backwards compatible with 2.6.x, so IMHO side-by-side installs is not necessary, however Python-3.x.x is not backwards compatible, so my recommendation would be to put Python-2.7 on your path and have Python-3 be an optional version by creating a shortcut to its executable called python3 (this is a common setup on Linux). The official Python default install path on Windows is</p> <ul> <li>C:\Python33 for 3.3.x (latest 2013-07-29)</li> <li>C:\Python32 for 3.2.x</li> <li>&amp;c.</li> <li>C:\Python27 for 2.7.x (latest 2013-07-29)</li> <li>C:\Python26 for 2.6.x</li> <li>&amp;c.</li> </ul></li> <li><p>If OP is not updating Python, but merely updating packages, they may wish to look into <a href="https://pypi.python.org/pypi/virtualenv" rel="nofollow noreferrer">virtualenv</a> to keep the different versions of packages specific to their development projects separate. <a href="https://pypi.python.org/pypi/pip" rel="nofollow noreferrer">Pip</a> is also a great tool to update packages. If packages use binary installers I usually uninstall the old package before installing the new one.</p></li> </ol> <p>I hope this clears up any confusion.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload