0

I've been writing code in python 3.3.5, but whenever I run one of my py files, it is always ran in python 2. I used to have python 2.7 installed, but then I uninstalled it, so I don't know why this is the case. Even when I type in "python" on command line, it comes up with "python 2.7.3 default", even though I deleted it. I can prove this because one of my scripts is this:

print("Hello)
input()
print("Bye")
input()

It says hello, then gives a traceback error when I hit the enter key. But if I change the coding so that the inputs are instead raw_input, then it works fine. Also Tkinter works instead of tkinter. Yet I am coding this all with python 3.3.5

1 Answers1

0

Since you mentioned having problems assigning your PATH variables to the correct execution location in Windows, you might try the following:

  1. Edit your environment variables

    enter image description here

  2. Scroll down to Path, select path, click edit.

  3. Add C:\Python27; You should in your case have 2 versions of python there. If you don't you could add the following:

    C:\Python27;C:\Python335;

  4. Navigate to the Python27 folder in C:\ and change python.exe to python2.exe

  5. Navigate to the Python335 folder in C:\ and change python.exe to python3.exe

  6. Open up command prompt and type python2

  7. Then, in command prompt, type python3

You should see different output at this point denoting that you have different versions active.

Community
  • 1
  • 1
Nathaniel Payne
  • 2,749
  • 1
  • 28
  • 32