Environmental Variables

A forum for general discussion of the Python programming language.

Environmental Variables

Postby frisbee777 » Sun Jun 23, 2013 11:45 pm

I need help setting up the PATH that python will use.. I'm trying to .zip backup files and save them to another folder....
This is the error I keep getting..

zip' is not recognized as an internal or external command,
operable program or batch file.
zip -qr C:\Backup\20130623191049.zip "C:\My Documents" C:\Code
Backup FAILED

Thank you in advance for any help
frisbee777
 
Posts: 9
Joined: Sun Jun 23, 2013 11:31 pm
Location: South Carolina, USA

Re: Environmental Variables

Postby setrofim » Mon Jun 24, 2013 6:30 am

setrofim
 
Posts: 288
Joined: Mon Mar 04, 2013 7:52 pm

Re: Environmental Variables

Postby frisbee777 » Mon Jun 24, 2013 10:03 am

Thanks setrofim.. That link has a lot of information I can use :D .. The coding is not really the issue.. it's getting it to function with my OS.. After thinking about it I did leave out some info..

I'm running win7 and python 3.3
I need to add "C:\Program Files\GnuWin32\bin" to my system PATH Environment Variable..

I actually had to create the "PATH"... # is there another Environment Variable I should use.. I'm open to any suggestions
in PATH I entered C:\python33 to get my editor to work on executing any code, maybe I'm using an outdated editor (komodo edit 8)
frisbee777
 
Posts: 9
Joined: Sun Jun 23, 2013 11:31 pm
Location: South Carolina, USA

Re: Environmental Variables

Postby metulburr » Mon Jun 24, 2013 11:58 am

what does zipping have to do with the path variable? And why are you adding
C:\Program Files\GnuWin32\bin
to the path?
New Users, Read This
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
https://github.com/metulburr
steam
User avatar
metulburr
 
Posts: 1387
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY

Re: Environmental Variables

Postby frisbee777 » Tue Jun 25, 2013 10:20 am

I'm using "A byte of python" to learn Python... on page 76 I'm instructed to add
C:\Program Files\GnuWin32\bin to my systems PATH Environmental Variable
The goal is to zip and archive files in "My Documents" to a back up folder

using "A byte of Python" to learn because it is the most up to date material I have found

is there other material that is up to date with 3.3? I can reference
frisbee777
 
Posts: 9
Joined: Sun Jun 23, 2013 11:31 pm
Location: South Carolina, USA

Re: Environmental Variables

Postby metulburr » Tue Jun 25, 2013 2:02 pm

well if your just using python to zip My Documents, then zipfile would be appropriate. Reference material is either 2.x or 3.x, the version within is near moot.
New Users, Read This
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
https://github.com/metulburr
steam
User avatar
metulburr
 
Posts: 1387
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY

Re: Environmental Variables

Postby Mekire » Tue Jun 25, 2013 2:46 pm

If you really want to append this to your path on windows 7:

Code: Select all
1: Click the windows icon in the bottom left corner.
2: Type "environment variables" into the search box.
3: Click "Edit the system environment variables" (it should appear at the top)
4: Click "Environment Variables" in the bottom right of the window you see.
5: Find the entry path in the bottom "system variables" section and click it.
6: Click "Edit"
7: At the end of the Variable value field add a semi-colon ";", followed by the path you wish to add.


Be careful not to accidentally erase the stuff that is already there.

-Mek
User avatar
Mekire
 
Posts: 986
Joined: Thu Feb 07, 2013 11:33 pm
Location: Amakusa, Japan

Re: Environmental Variables

Postby frisbee777 » Thu Jun 27, 2013 12:04 am

Mekire; Thank you, I'm going in the right direction.. I understand up to step 4.. There are several PATH(S) in my EV.. The "entry PATH" is the confusing part.
I have 3 in my EV CLASSPATH, PATHEXT, PSModulePath, and just plain ol "PATH" I created.. to tinker with.. It would not surprise me it there were a lot of
different "path(s)' on different computers.... have any ideas? maybe

I did not accidentally erase the stuff already there... But I used L.E.A.D.2 computer to back me up just in case
frisbee777
 
Posts: 9
Joined: Sun Jun 23, 2013 11:31 pm
Location: South Carolina, USA

Re: Environmental Variables

Postby metulburr » Thu Jun 27, 2013 1:03 am

There should be just plain old
Code: Select all
Path

evironmental variable

The process would be the same as here (read the first windows section, which is setting the path), except for the fact that you are not putting in python's path, but
Code: Select all
C:\Program Files\GnuWin32\bin
New Users, Read This
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
https://github.com/metulburr
steam
User avatar
metulburr
 
Posts: 1387
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY

Re: Environmental Variables

Postby Mekire » Thu Jun 27, 2013 4:20 am

ev.png
ev.png (32.59 KiB) Viewed 1877 times


-Mek
User avatar
Mekire
 
Posts: 986
Joined: Thu Feb 07, 2013 11:33 pm
Location: Amakusa, Japan

Re: Environmental Variables

Postby frisbee777 » Fri Jun 28, 2013 10:04 am

Mekire, Metulburr, As luck would have it.... I did not have just plain old "Path" or "PATH" in my Environmental Variables... Not sure why, but it was not there...
I'm using the information you two have supplied and try to get it working.

I'm running Komodo edit 8 as my interface. I typed in "path" (only) in command line box.. why? I do not know I just did
it came back "PATH=C:\Python33\python.exe" without executing the code.. In the advanced area of the run command I can enter/add an EV path
I might tinker with komodo's EV for a while and see what happens..

Thanks for all the help and suggestions.. If anyone else has an idea let me know I will try it muhahahahahahahaha!!!!!!
frisbee777
 
Posts: 9
Joined: Sun Jun 23, 2013 11:31 pm
Location: South Carolina, USA

Re: Environmental Variables

Postby metulburr » Fri Jun 28, 2013 2:07 pm

Are you on windows 7?
New Users, Read This
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
https://github.com/metulburr
steam
User avatar
metulburr
 
Posts: 1387
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY

Re: Environmental Variables

Postby frisbee777 » Fri Jun 28, 2013 6:38 pm

Yes, Windows 7
frisbee777
 
Posts: 9
Joined: Sun Jun 23, 2013 11:31 pm
Location: South Carolina, USA

Re: Environmental Variables

Postby metulburr » Fri Jun 28, 2013 6:48 pm

To be honest i dont know the process if the Path ev is not there. As i have alwyas had it there on any win 7 OS install i have done on any pc. Plus i dont use windows any more as i an in linux all the time.

I would test out appending the path to each one, one by one, removing the previous one to find the right one. That would be the onjly sure way to find the correct one then, although painfully slow. If none of those work, i would make a Path and add that path to the new Path, and see what happens out of it.
New Users, Read This
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
https://github.com/metulburr
steam
User avatar
metulburr
 
Posts: 1387
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY

Re: Environmental Variables

Postby frisbee777 » Sun Jun 30, 2013 1:42 am

Metulburr; I believe the "path" is working now. I can modify the path through the komodo editor... I 'm having issues with finding the zip file (go figure)... I will pursue that later.. I need to move on and learn more code
Thanks for the infomation and help... Mekire.. thanks goes to you too... you got me headed in the right direction...
frisbee777
 
Posts: 9
Joined: Sun Jun 23, 2013 11:31 pm
Location: South Carolina, USA

Re: Environmental Variables

Postby gbstack » Sun Jun 30, 2013 7:21 am

type in "echo %PATH%" in cmd command line box and see what the output is
gbstack
 
Posts: 2
Joined: Sun Jun 30, 2013 7:03 am

Re: Environmental Variables

Postby frisbee777 » Sat Jul 06, 2013 6:05 pm

gbstack; Entered: C:\echo%PATH%.... Response: The filename, directory name, or volume label syntax is incorrect ....
frisbee777
 
Posts: 9
Joined: Sun Jun 23, 2013 11:31 pm
Location: South Carolina, USA

Re: Environmental Variables

Postby metulburr » Sat Jul 06, 2013 6:26 pm

gbstack; Entered: C:\echo%PATH%.... Response: The filename, directory name, or volume label syntax is incorrect ....


that is because you did not enter the command correctly. Note the space between the command echo and the argument %PATH%, for example:
Code: Select all
C:\Windows\System32>echo %PATH%
C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\Wind
owsPowerShell\v1.0\;C:\Python33

C:\Windows\System32>
New Users, Read This
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
https://github.com/metulburr
steam
User avatar
metulburr
 
Posts: 1387
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY

Re: Environmental Variables

Postby frisbee777 » Sun Jul 07, 2013 4:25 pm

Thanks metulburr; I did not catch the space between "echo" and "%" and path came up... It's the one I created..
Does the computer look at all the EVs when it starts up? i.e. PSModulePath, PATHEXT or ClassPATH these paths are in my EV
frisbee777
 
Posts: 9
Joined: Sun Jun 23, 2013 11:31 pm
Location: South Carolina, USA

Re: Environmental Variables

Postby metulburr » Sun Jul 07, 2013 4:27 pm

what is the output of that command?
New Users, Read This
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
https://github.com/metulburr
steam
User avatar
metulburr
 
Posts: 1387
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY


Return to General Discussions

Who is online

Users browsing this forum: No registered users and 2 guests