How to use multiple versions of Python without uninstallation

前端 未结 15 1765
醉梦人生
醉梦人生 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条回答
  •  旧时难觅i
    2021-02-05 15:02

    You simply install multiple versions in separate directories, and then you run the python program with the Python version you want to use. Like so:

    C:\Python26\Python.exe thescript.py
    

    Or similar.

    What virtualenv does is that it gives you many separate "virtual" installations of the same python version. That's a completely different issue, and hence it will not help you in any way.

提交回复
热议问题