How can I make the “python” command in terminal, run python3 instead of python2?

后端 未结 6 1787
天涯浪人
天涯浪人 2020-12-31 03:53

I\'m just starting to learn Python and did search around a little, so forgive me if this has been asked and answered.

When running scripts through the command line/t

6条回答
  •  北荒
    北荒 (楼主)
    2020-12-31 04:24

    Sounds like you have python 2 and 3 installed and your pythonpath is pointed at python 2, so unless specified it uses that version. If you are using python I would suggest setting up a virtual environment (virtualenv) for each project, which means you could run whatever version you'd like in that project and keep all dependencies contained.

提交回复
热议问题