Path Problem on W2K?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • hokiegal99

    Path Problem on W2K?

    I installed Python-2.3 into c:\Program Files\Python23 on a new W2K SP4
    computer. When I write a Python script and run it from the command
    prompt, I get the following error:

    C:\>python 'name-of-script.py'
    'python' is not recognized as an internal or external command,
    operable program or batch file.

    Here's what my path contains:

    C:\>path
    PATH=C:\WINNT\s ystem32;C:\WINN T;C:\WINNT\Syst em32\Wbem;"C:\P rogram
    Files\Norton
    SystemWorks\Nor ton Ghost\";C:\Prog ram Files\SSH Communications
    Security\SSH Secu
    re Shell

    Any ideas? I've reinstalled and rebooted several times. Also tried
    adding c:\Program Files\Python23 to my path... still get the error.
  • Bertrand Geston

    #2
    Re: Path Problem on W2K?


    "Bernard Delmée" <bdelmee@advalv as.REMOVEME.be> a écrit dans le message
    news: 3f3fd1c8$0$1122 $6c56d894@feed0 .news.be.easyne t.net...[color=blue][color=green]
    > > Also tried adding c:\Program Files\Python23 to my path...[/color]
    >
    > This should work, though! Still it's advisable to install to
    > a path without space(s), otherwise the "idle" IDE won't work.
    >[/color]
    Try with "C\Program Files\Python23" in your path (with the quotes). Could
    help you (or not :-( )
    If you change your path in the System box, I suspect (not sure) that you
    need to open a new DOS box to have the new PATH.
    Good luck.





    Comment

    • Bengt Richter

      #3
      Re: Path Problem on W2K?

      On 17 Aug 2003 10:27:17 -0700, hokiegal99@hotm ail.com (hokiegal99) wrote:
      [color=blue]
      >I installed Python-2.3 into c:\Program Files\Python23 on a new W2K SP4
      >computer. When I write a Python script and run it from the command
      >prompt, I get the following error:
      >
      >C:\>python 'name-of-script.py'
      >'python' is not recognized as an internal or external command,
      >operable program or batch file.
      >
      >Here's what my path contains:
      >
      >C:\>path
      >PATH=C:\WINNT\ system32;C:\WIN NT;C:\WINNT\Sys tem32\Wbem;"C:\ Program
      >Files\Norton
      >SystemWorks\No rton Ghost\";C:\Prog ram Files\SSH Communications
      >Security\SSH Secu
      >re Shell
      >
      >Any ideas? I've reinstalled and rebooted several times. Also tried
      >adding c:\Program Files\Python23 to my path... still get the error.[/color]

      I generally avoid installing in c:\Program<abom inable_space>Fi les\anything.
      The space just creates a nuisance when you want to use the path simply
      in other contexts than they had in mind. Could be that's happening.

      If you don't get a simple answer, I would uninstall and then reinstall as
      c:\python23\... or c:\myInstalls\p ython23\ etc. I use a separate partition
      and put it at D:\python23\...

      Then add ;C:\python23 or whatever you decide (something without embedded spaces ;-)
      onto the path.
      ( probably settings>contro l panel>system>en vironment>... or similar on your system).
      If you are in a console window, you will have to restart that, at least, for the path
      change to show up, if it works like mine.

      HTH

      Regards,
      Bengt Richter

      Comment

      • Irmen de Jong

        #4
        Re: Path Problem on W2K?

        Bertrand Geston wrote:[color=blue]
        > "Bernard Delmée" <bdelmee@advalv as.REMOVEME.be> a écrit dans le message
        > news: 3f3fd1c8$0$1122 $6c56d894@feed0 .news.be.easyne t.net...
        >[color=green][color=darkred]
        >>>Also tried adding c:\Program Files\Python23 to my path...[/color]
        >>
        >>This should work, though! Still it's advisable to install to
        >>a path without space(s), otherwise the "idle" IDE won't work.
        >>[/color]
        >
        > Try with "C\Program Files\Python23" in your path (with the quotes). Could
        > help you (or not :-( )[/color]

        That should have read "C:\Program Files\Python23" .
        If it doesn't work, try

        C:\Progra~1\Pyt hon23

        This squiggle-path is the 8.3 notation.
        --Irmen

        Comment

        • Dennis Reinhardt

          #5
          Re: Path Problem on W2K?

          > I generally avoid installing in
          c:\Program<abom inable_space>Fi les\anything.

          c:\progra~1\any thing

          is a non-space way of specifying the same path.

          --

          Dennis Reinhardt

          DennisR@dair.co m http://www.spamai.com?ng_py


          Comment

          • Irmen de Jong

            #6
            Re: Path Problem on W2K?

            Dennis Reinhardt wrote:[color=blue][color=green]
            >>I generally avoid installing in[/color]
            >
            > c:\Program<abom inable_space>Fi les\anything.[/color]

            Related, but off-topic at the same time,
            I've seen many programs on Windows that barf on the
            default TEMP directory on Windows 2000 and XP.
            That is defined as somewhere in

            c:\documents and settings\userna me\temporary files

            or something. Anyway, it contains one or more spaces.
            Many -broken- tools (mostly installers!) choke on this,
            that's why I always set TEMP (and TMP) to "C:\temp"
            as soon as I get my hands on a 'clean' Win2000/Xp box...
            (yup, get rid of the per-user-tempdir).

            Bah. ;-)

            spaces-in-paths-are-evilly-y'rs, Irmen de Jong

            Comment

            • Graham Fawcett

              #7
              Re: Path Problem on W2K?

              hokiegal99@hotm ail.com (hokiegal99) wrote in message news:<93f5c5e9. 0308170927.6e0b dc38@posting.go ogle.com>...[color=blue]
              > I installed Python-2.3 into c:\Program Files\Python23 on a new W2K SP4
              > computer. When I write a Python script and run it from the command
              > prompt, I get the following error:
              >
              > C:\>python 'name-of-script.py'
              > 'python' is not recognized as an internal or external command,
              > operable program or batch file.
              >
              > Here's what my path contains:
              >
              > C:\>path
              > PATH=C:\WINNT\s ystem32;C:\WINN T;C:\WINNT\Syst em32\Wbem;"C:\P rogram
              > Files\Norton
              > SystemWorks\Nor ton Ghost\";C:\Prog ram Files\SSH Communications
              > Security\SSH Secu
              > re Shell
              >
              > Any ideas? I've reinstalled and rebooted several times. Also tried
              > adding c:\Program Files\Python23 to my path... still get the error.[/color]


              Just a thought, but the SUBST command still works in Win2K.

              C:\>subst /?
              Associates a path with a drive letter.

              SUBST [drive1: [drive2:]path]

              Substitute drive letter "P" for C:\Program Files\python23. Then, add
              P:\ to your path.

              Benefits? No nasty spaces, a much shorter path, and quick access to
              the Python directory when you're at the command line (just type "P:").

              (To be fair, assigning P: to c:\Program Files, and adding P:\python23
              to your path, is probably an idea with more mileage in it.)

              I haven't used this specifically myself (I install python in
              c:\python##), but I have often SUBST'd the drive letter S: for
              \python##\lib\s ite-packages when I'm studying the code of a
              recently-installed package. Much easier to pop open an editor window,
              or a Explorer window, to "S:\somepackage " than its longer counterpart.

              It might be quite fun to go SUBST-happy and transform all those lonely
              unassigned drive letters into contributing members of society. Perhaps
              U: could map to c:\Documents and Settings, W: could map to %WINDIR%,
              X: to the folder where you hide your illicitly-gained MP3's...

              It would be best to do the SUBST before login or service startup. I
              *think* you can still use an autoexec.bat file in Win2K, but there's a
              formal "startup script" approach that is blessed by Microsoft. Search
              MS support for "How to Run a Batch File Before Logging on to Your
              Computer".

              Hope it helps.

              -- Graham

              Comment

              • Duncan Booth

                #8
                Re: Path Problem on W2K?

                Peter Hansen <peter@engcorp. com> wrote in
                news:3F40F62D.8 B32CFBD@engcorp .com:
                [color=blue]
                > Generally, for something like "Secure Shell", I find it much
                > easier just to write a little batch file that knows the full
                > path. Put these batch files in a directory called c:\bin
                > or c:\utils or something and add *that* to your path. Then
                > you can avoid excessive PATH creepage...
                >[/color]

                Alternatively create doskey macros for commands like that then you just
                need one file with a load of macro definitions.

                --
                Duncan Booth duncan@rcp.co.u k
                int month(char *p){return(1248 64/((p[0]+p[1]-p[2]&0x1f)+1)%12 )["\5\x8\3"
                "\6\7\xb\1\x9\x a\2\0\4"];} // Who said my code was obscure?

                Comment

                • Duncan Booth

                  #9
                  Re: Path Problem on W2K?

                  Peter Hansen <peter@engcorp. com> wrote in
                  news:3F41FECA.6 743B6BD@engcorp .com:
                  [color=blue][color=green]
                  >> Alternatively create doskey macros for commands like that then you just
                  >> need one file with a load of macro definitions.[/color]
                  >
                  > Does that let you execute them from other batch files? I
                  > have a few dozen utilities which run Python scripts by executing
                  > "call python scriptname.py" somewhere, relying on a .bat file
                  > in the PATH. Does the DOSKEY approach work similarly?[/color]

                  No, DOSKEY just affects what you type, you would have to write the commands
                  out in full in a batch file.

                  If you are running a lot of Python scripts from the command prompt or batch
                  files, consider adding .py to the PATHEXT environment variable, that will
                  let you run scripts directly, e.g. "scriptname " instead of "python
                  scriptname.py", and will search PATH for the scripts. (However be aware
                  that redirecting doesn't work on most versions of windows for scripts
                  invoked this way!)

                  --
                  Duncan Booth duncan@rcp.co.u k
                  int month(char *p){return(1248 64/((p[0]+p[1]-p[2]&0x1f)+1)%12 )["\5\x8\3"
                  "\6\7\xb\1\x9\x a\2\0\4"];} // Who said my code was obscure?

                  Comment

                  Working...