Changing default python to another version

后端 未结 7 741
死守一世寂寞
死守一世寂寞 2021-01-01 05:35

Currently when I use \"python\" command, it points to python2.6. I have installed python3.1 and I want the \"python\" command point to python3.1. How it is possible?

7条回答
  •  渐次进展
    2021-01-01 06:22

    You really don't want to change what python points to, because some programs might expect Python 2, and break.

    The solution is to use virtualenv: create an isolated Python 3 environment (with the -p python3 option), activate it, and you're good to go.

提交回复
热议问题