0

I can't get windows to use python 3 as default.

I have both versions of python (2.7 & 3.6) installed on my windows 10 pc. I installed python 3 from python.org and ticked the add to PATH box. I've spent a week on and off looking for solutions to getting Bash and Atom to use python 3 as default, including:

  • changing the environmental path order,
  • reinstalling python3 (so far three times!),
  • using $ python3.6 (or variations of this text I've found online) in git,
  • configuring atom-python-run to run python3 (this just flashes a python window, nothing further happens),
  • Bash out put:

    $ python --version Python 2.7.17

  • I downloaded the ubuntu for windows app. This displays the following:

    python3 --version Python 3.6.7.

I'm struggling to come up with other ideas that could work (even with the hours of Googling). If anyone could help I'd be grateful.

Thanks.

7
  • 2
    Uninstall 2.7? :-) Commented Jan 29, 2020 at 1:55
  • I was worried it would be used for something else on my pc. Is there anything it could effect that you can think of? Otherwise, I'm happy to Commented Jan 29, 2020 at 1:58
  • Well, I don't know what's on your PC. Of course there could be something that uses it. Commented Jan 29, 2020 at 2:04
  • If uninstalling 2.7 causes a problem, you can always reinstall it. Commented Jan 29, 2020 at 2:09
  • 1
    This is one reason why virtual environments (and similar tools) are great. Commented Jan 29, 2020 at 2:12

1 Answer 1

1

My question is why do you have both versions. Then here is your anwser for your question. You can simply just uninstall 2.7, and use 3.6 for the project. When you need 2.7 just simply reinstall it.

You could also try to find a software that will just turn off python 2.7, but sadly I dont know of such software.

Another thing is just right your python file, change dir into the project. Then do the command python3 pythonFileName.py in your console, and it would run the project using python3.

Hope this helps! If you have any questions feel free to comment on this anwser.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks. I uninstalled 2.7. Has fixed it and don't seem to have any problems so far.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.