Sublime Forum

I broke Hello World... system can't find file specified

#1

I’m new to Sublime text, new to Python and pretty rusty when it comes to programming in general. I’m familiar with VBA (macros for excel) and SQL. I downloaded Sublime text.
I entered four lines of code:

[code]#!/usr/bin/env python3

print (“hello, world!”)
[/code]

and I’m getting this message:

[quote]The system cannot find the file specified
[cmd: [u’python’, u’-u’, u’’]]
[dir: C:\Windows\system32]
[path: C:\Program Files (x86)\HP SimplePass 2011\x64;C:\Program Files (x86)\HP SimplePass 2011;;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;c:\Program Files (x86)\Common Files\Roxio Shared\DLLShared;c:\Program Files (x86)\Common Files\Roxio Shared\DLLShared;c:\Program Files (x86)\Common Files\Roxio Shared\12.0\DLLShared;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\Intel\Services\IPT;C:\Program Files (x86)\Common Files\Intuit\QBPOSSDKRuntime;C:\Program Files (x86)\QuickTime\QTSystem;C:\Program Files\Microsoft SQL Server\110\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn;C:\Program Files\Microsoft SQL Server\110\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn]
[Finished][/quote]

I have no idea how I broke “Hello, World!” and I have no idea why the error is calling out programs in the path like QuickTime or Intuit (that’s quickbooks). Frankly I’m lost…

My system specs are an intel i3 with Windows 7 home. I have installed Java 3.3.

As a side: I’ve also tried IdleX, DrPython and Eclipse with PyDev. The first two were awful and the last was fine until I wanted to run something. It couldn’t ever run the code. I digress.

I just need help figuring out how to get Sublime Text 2 to read the Python code without throwing that error. I’m guessing it’s a problem with subdirectories, but then again, it’s only a guess.

On a last note, does anybody know where I can find an actual “getting started with Sublime Text 2” for Python. I found a couple, but they already assume that I know the user interface. I had never even heard of it until I was looking for a great Python editor. I know that I enter code in the editor, and then, I think I go to tool --> then Build. I haven’t found anyone to tell me if this is correct or not. I guess it’s assumed that if you made it this far then you know what you’re doing…Grrr. That’s how new I am to this…

Thanks to anyone and everyone who helps in advance!

EDIT UPDATE: As of this edit, I have uninstalled and reinstalled both sublime text 2 and Python 3.3. The error message remains the same. I’m wondering if I need to point the editor towards a file in Python. I’m not finding much luck on search engines. Most problems have a specific error and most of them are tied to probles with syntax or subdirectories.

I’ve also tried running a single line “Hello, World!” and removing the shebang line. I STILL get the same error. for some reason Sublime Text can’t find Python.

0 Likes

#2

I think you need to go to My Computer ‣ Properties ‣ Advanced ‣ Environment Variables, then edit PATH and add “C:\python3;” to the front, where C:\python3 is the path where you installed Python. It might be something like C:\python33.

0 Likes

#3

It looks like python is not in your system PATH.

The shebang line is not applicable to Windows. On Windows, when Sublime runs Python, it relies on your PATH to find the executable.

When you installed python, there was an option to “add python.exe to PATH”. This may be turned off by default. You can add it to your path by either:

  • Re-run the python installer, choose “Change Python 3.3.0” and make sure the option to add it to your PATH is enabled.

  • Or add it to the PATH manually. At least on Windows 7 it is:
    [list]
    *]Control Panel

  • System

  • Advanced system settings

  • “Environment Variables” button

  • Find “Path” in the system variables.

  • Click “Edit” and add “C:\Python33;” to the front of the list (use the correct location where you installed Python).

/*:m][/list:u]

Close and relaunch Sublime after doing this so it will pick up the change.

You can verify what your path looks like by bringing up the console in Sublime (ctrl-`) and typing os.getenv(“PATH”)

Another option is to update the sublime build settings if you’re so inclined.

This video series may help you with Sublime: tutsplus.com/course/improve-wor … me-text-2/
But it is not python-specific. Sublime isn’t really an IDE, it is a text editor. You might want to learn more about Sublime’s “build” system if you want to run things directly from Sublime. I don’t have much experience with it, though.

0 Likes

#4

RESOLVED!

Thank you to both **sapphirehamster **and adzenith! It was a problem with the path. It’s one of those things that’s easy to fix when you know what you’re looking for. I’d never had to modify the path before, so this was a great lesson for me.

Sometimes I know just enough to be dangerous, but not enough to be helpful.
Thanks again to both of you!

0 Likes

#5

Glad you got it working! Enjoy Python!

0 Likes