0

I have tried to install Python 3.4 on Windows 7 using the following guide I have added the following to my Path in system environmental variables

C:\Python34\;C:\Python34\Scripts;

When I open up the Python command line and type the following (as instructed in the tutorial) I receive an error message printed below

Python 3.4.2 (v3.4.2:ab2c023a9432, Oct 6 2014, 22:15:05) [MSC v.1600 32 bit (In tel)] on win32 Type "help", "copyright", "credits" or "license" for more information.

python --version <- what i type

Traceback (most recent call last): File "", line 1, in NameError: name 'python' is not defined

Can anyone help me out?

1
  • 2
    You have to write python --version in the systems command line, not in the interactive Python interpreter. Commented Nov 11, 2014 at 20:27

2 Answers 2

1

You need to type python --version from the command line. Not when you are already running python.

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

3 Comments

Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\Users\Chris>cd .. C:\Users>cd .. C:\>python Python 3.4.2 (v3.4.2:ab2c023a9432, Oct 6 2014, 22:15:05) [MSC v.1600 32 bit (In tel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> python --version Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'python' is not defined >>>
I am having the same error with the CMD as shown above
C:\Users\Chris>python --version
1

As has been mentioned, you need to run your command from the command prompt:

python --version

However, if you are in the python interpreter, you can find the current version with this code:

import sys
print (sys.version)

1 Comment

I am having the same trouble in cmd...Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\Users\Chris>cd .. C:\Users>cd .. C:\>python Python 3.4.2 (v3.4.2:ab2c023a9432, Oct 6 2014, 22:15:05) [MSC v.1600 32 bit (In tel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> python --version Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'python' is not defined >>>

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.