Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing multiple main and bit versions of Python

What would be the best way/order to install both 32 and 64 bit versions of Python 2.7 and Python 3.3 if I want 64 bit Python 3.3 to be the default when I open .py files?

I already have the 32 bit version of each installed, with defaults set to Python 3.3.


If it is fine to just rename the directory of my currently installed version, will python27.dll and programmes using it (or python33.dll) continue to work? This library gets installed to %WINDIR%\System32 and/or %WINDIR%\SysWoW64 by the python installer.


Thanks for your answers, here is what I did:

  1. Uninstalled Python 3.3 (This left 2 files)
    • C:\Python33\Lib\lib2to3\Grammar3.3.0.final.0.pickle
    • C:\Python33\Lib\lib2to3\PatternGrammar3.3.0.final.0.pickle
  2. Uninstalled Python 2.7
  3. Installed Python 2.7 x86 (without register extensions)
    • C:\Python\27_32\
  4. Installed Python 2.7 x86-64 (without register extensions)
    • C:\Python\27\
  5. Installed Python 3.3 x86 (without register extensions)
    • C:\Python\33_32\
  6. Installed Python 3.3 x86-64 (with default register extensions)
    • C:\Python\33\
  7. Deleted C:\Python33
    • CCleaner'd installer reference issues to this location
like image 593
Paul S. Avatar asked Nov 15 '12 02:11

Paul S.


People also ask

Can you install multiple versions of Python?

If you wish to use multiple versions of Python on a single machine, then pyenv is a commonly used tool to install and switch between versions. This is not to be confused with the previously mentioned depreciated pyvenv script. It does not come bundled with Python and must be installed separately.

Can I install two Python versions on Windows?

Installing multiple versions of Python I will be using Python 3.10 and Python 2.7. You can download the installer for Python 2.7 here. You can learn to install python2 on Windows here. You can download the installer for Python 3.10 here.

How do I switch between Python versions?

Yes, you should be able to switch between python versions. As a standard, it is recommended to use the python3 command or python3. 7 to select a specific version. The py.exe launcher will automatically select the most recent version of Python you've installed.


1 Answers

The installer typically has an option for "Set file associations" that handles that, and I think it's on by default, which means that the most-recently-installed one will handle double-clicking .py files. So install 64-bit Python 3.3 last and it should work. I just did this a few days ago with 32- and 64-bit version of 2.7 and it seems to work fine.

I wouldn't rename your existing directory, though. You should install each version of Python in its own directory.

like image 103
BrenBarn Avatar answered Nov 07 '22 15:11

BrenBarn