How to use multiple versions of Python without uninstallation

前端 未结 15 1547
醉梦人生
醉梦人生 2021-02-05 14:11

I am faced with a unique situation, slightly trivial but painful.

I need to use Python 2.6.6 because NLTK is not ported to Python 3 (that\'s what I could gather).

15条回答
  •  北恋
    北恋 (楼主)
    2021-02-05 14:59

    Take a look on WinPython, a nice portable/installable python distribution for Windows.

    Portable: preconfigured, it should run out of the box on any machine under Windows (without any requirement) and the folder containing WinPython can be moved to any location (local, network or removable drive) with most of the application settings

    Flexible: one can install (or should I write "use" as it's portable) as many WinPython versions as necessary (like isolated and self-consistent environments), even if those versions are running different versions of Python (2.7, 3.3) or different architectures (32bit or 64bit) on the same machine

    It also allows you to register and unregister easily a given python version as the system default one.

    But even working as portable, you can make a shortcut of the python executable and put it somewhere in your path. Just name the shortcuts of different versions different names. Then you can just use:

    python_3_64bit_shortcut your_program.py
    

提交回复
热议问题