[Tutor] issues running python

Alan Gauld alan.gauld at yahoo.co.uk
Tue Mar 26 20:40:50 EDT 2019


On 26/03/2019 21:41, Drew Jakala wrote:
> Hello,
> I'm having issues running python and sublime on my computer. Every time I
> try to run either one I get an error message that looks something like this:
>  "Traceback (most recent call last):
>   File "<pyshell#0>", line 1, in <module>
>     python
> NameError: name 'python' is not defined
> I think I need to edit my path but I'm not sure how to do that correctly so
> any help would be greatly appreciated.

I know nothing about Sublime but it might help if you tell us what OS
you use and how exactly you try to run sublime.

The error you show us is coming from python itself so it looks like you
are trying to run python from inside python.

I suspect you may be following some kind of tutorial or help page
that says you should type something like:

python foo.py

This means from the OS pronpt you should type the line given.
But you are trying to type it at a python interpreter prompt.
The OS prompt usually looks like:

C:\WINDOWS>

or

user at host$

or similar.

The Python prompt usually looks like

>>>

You only type "python" at the OS prompt.

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list