* Inferior Python Mode
@ 2007-08-07 6:35 Matt
2007-08-07 9:08 ` Hadron
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: Matt @ 2007-08-07 6:35 UTC (permalink / raw)
To: help-gnu-emacs
I am a newbie with emacs and am trying to open an inferior python
buffer. I have emacs 22.1.1 and python 2.5.1 on a windows xp system.
Both work well indepenently from eachother (python in IDLE), however,
when I type "M-x run-python" I get the message "Searching for program:
no such file or directory, python". Can anyone give me a pointer on
how to help emacs find and execute pyton?
I at first thought I had to use the lisp command load-path in
my .emacs file to help emacs find my Python directory but I have had
no luck with that.
(setq load-path (cons "C:\Python25" load-path))
Anything would help, even a reference.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Inferior Python Mode
2007-08-07 6:35 Inferior Python Mode Matt
@ 2007-08-07 9:08 ` Hadron
2007-08-07 14:48 ` Matt
2007-08-07 15:58 ` Sönmez Kartal
2007-08-08 14:52 ` Stefan Monnier
2 siblings, 1 reply; 10+ messages in thread
From: Hadron @ 2007-08-07 9:08 UTC (permalink / raw)
To: help-gnu-emacs
Matt <mcolemanfamily@gmail.com> writes:
> I am a newbie with emacs and am trying to open an inferior python
> buffer. I have emacs 22.1.1 and python 2.5.1 on a windows xp system.
> Both work well indepenently from eachother (python in IDLE), however,
> when I type "M-x run-python" I get the message "Searching for program:
> no such file or directory, python". Can anyone give me a pointer on
> how to help emacs find and execute pyton?
>
> I at first thought I had to use the lisp command load-path in
> my .emacs file to help emacs find my Python directory but I have had
> no luck with that.
> (setq load-path (cons "C:\Python25" load-path))
>
> Anything would help, even a reference.
>
What do you want to do?
If you have a python file open, emacs 22 should be in python-mode. or
you can open a blank file and M-x python-mode
There should then be a python menu which enables you to run a Python
interpreter in an emacs buffer.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Inferior Python Mode
2007-08-07 9:08 ` Hadron
@ 2007-08-07 14:48 ` Matt
0 siblings, 0 replies; 10+ messages in thread
From: Matt @ 2007-08-07 14:48 UTC (permalink / raw)
To: help-gnu-emacs
> What do you want to do?
>
> If you have a python file open, emacs 22 should be in python-mode. or
> you can open a blank file and M-x python-mode
>
> There should then be a python menu which enables you to run a Python
> interpreter in an emacs buffer.
OK, so if I open a new file and type M-x python-mode I can then edit
that file accoriding to python formatting. Then when I want to run
execute that file in python I type C-c C-c. I then get the same
message as before "Searching for program: no such file or directory,
python". It seems to me that emacs is executing the python-mode.elc
file just fine, however, when it searches to make a connection to the
actual python on my computer it cannot find it. Maybe I have to edit
my python-mode.el file to help it find my version of python? Anyone?
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Inferior Python Mode
2007-08-07 6:35 Inferior Python Mode Matt
2007-08-07 9:08 ` Hadron
@ 2007-08-07 15:58 ` Sönmez Kartal
2007-08-07 16:25 ` Matt
2007-08-08 14:52 ` Stefan Monnier
2 siblings, 1 reply; 10+ messages in thread
From: Sönmez Kartal @ 2007-08-07 15:58 UTC (permalink / raw)
To: help-gnu-emacs
On 7 A ustos, 09:35, Matt <mcolemanfam...@gmail.com> wrote:
> I am a newbie with emacs and am trying to open an inferior python
> buffer. I have emacs 22.1.1 and python 2.5.1 on a windows xp system.
> Both work well indepenently from eachother (python in IDLE), however,
> when I type "M-x run-python" I get the message "Searching for program:
> no such file or directory, python". Can anyone give me a pointer on
> how to help emacs find and execute pyton?
>
> I at first thought I had to use the lisp command load-path in
> my .emacs file to help emacs find my Python directory but I have had
> no luck with that.
> (setq load-path (cons "C:\Python25" load-path))
>
> Anything would help, even a reference.
You might haven't add your Python directory to the PATH variable? Can
you run python with just saying "python" in the command line, if not
add it to your PATH then try again. It should run then... and Emacs
would find "python" too, I guess...
Happy coding
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Inferior Python Mode
2007-08-07 15:58 ` Sönmez Kartal
@ 2007-08-07 16:25 ` Matt
2007-08-07 17:51 ` Sönmez Kartal
2007-08-08 14:53 ` Stefan Monnier
0 siblings, 2 replies; 10+ messages in thread
From: Matt @ 2007-08-07 16:25 UTC (permalink / raw)
To: help-gnu-emacs
> You might haven't add your Python directory to the PATH variable? Can
> you run python with just saying "python" in the command line, if not
> add it to your PATH then try again. It should run then... and Emacs
> would find "python" too, I guess...
>
Thanks for the help. However, I am not sure how to add Python to my
PATH variable. I have tried adding several lines to my .emacs file
without success. For example,
(add-to-list 'exec-Python25 "/foo/bar/")
I found this on another help page. My python directory is c:\Python25.
Is this even the right idea?
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Inferior Python Mode
2007-08-07 16:25 ` Matt
@ 2007-08-07 17:51 ` Sönmez Kartal
2007-08-08 14:53 ` Stefan Monnier
1 sibling, 0 replies; 10+ messages in thread
From: Sönmez Kartal @ 2007-08-07 17:51 UTC (permalink / raw)
To: help-gnu-emacs
On 7 A ustos, 19:25, Matt <mcolemanfam...@gmail.com> wrote:
> > You might haven't add your Python directory to the PATH variable? Can
> > you run python with just saying "python" in the command line, if not
> > add it to your PATH then try again. It should run then... and Emacs
> > would find "python" too, I guess...
>
> Thanks for the help. However, I am not sure how to add Python to my
> PATH variable. I have tried adding several lines to my .emacs file
> without success. For example,
> (add-to-list 'exec-Python25 "/foo/bar/")
> I found this on another help page. My python directory is c:\Python25.
> Is this even the right idea?
Yeah.. but I think Emacs runs the command line "python" at the
shell... So, ... If I remember correctly. Right click to "My
Computer" then switch to System tab.. or something similar.. or
"Advanced" I don't remember sorry.. You'd find a button named
"Environment Variables". Click to it and find PATH variable at the
bottom listbox of the window you'll see.. And add C:\Python25
directory to that path... If value of PATH ends with ';' character
just add "C:\Python25;" (Don't miss ; character at the end) If you
don't see any ';' at the end of PATH add ";C:\Python25;"...
Happy coding
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Inferior Python Mode
2007-08-07 6:35 Inferior Python Mode Matt
2007-08-07 9:08 ` Hadron
2007-08-07 15:58 ` Sönmez Kartal
@ 2007-08-08 14:52 ` Stefan Monnier
2 siblings, 0 replies; 10+ messages in thread
From: Stefan Monnier @ 2007-08-08 14:52 UTC (permalink / raw)
To: help-gnu-emacs
> (setq load-path (cons "C:\Python25" load-path))
That's almost right, except you need to double the \ because \ is used as an
escape sequence in Elisp strings. Better yet: use / instead of \ so you
don't need to double it. It'll work just as well:
(setq load-path (cons "C:/Python25" load-path))
Now, of course this will only work if the "python" executable is
at C:/Python25/python.exe (rather than elsewhere such as in a subdirectory).
Stefan
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Inferior Python Mode
2007-08-07 16:25 ` Matt
2007-08-07 17:51 ` Sönmez Kartal
@ 2007-08-08 14:53 ` Stefan Monnier
2007-08-09 15:50 ` Matt
1 sibling, 1 reply; 10+ messages in thread
From: Stefan Monnier @ 2007-08-08 14:53 UTC (permalink / raw)
To: help-gnu-emacs
> For example,
> (add-to-list 'exec-Python25 "/foo/bar/")
> I found this on another help page.
Who needs confusion when you can get such "help"?
Stefan
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Inferior Python Mode
2007-08-08 14:53 ` Stefan Monnier
@ 2007-08-09 15:50 ` Matt
2007-08-09 17:52 ` Stefan Monnier
0 siblings, 1 reply; 10+ messages in thread
From: Matt @ 2007-08-09 15:50 UTC (permalink / raw)
To: help-gnu-emacs
Just for completeness of the thread this is what worked for me
Right click to "My Computer" then go to Properties
Switch to the Advanced tab
At the bottom of the advanced tab click "Environment Variables"
Click "Path" in the bottom list box named System Variables and then
Edit
Add C:\Python25 to the Path list
Each different path should be separated with ;
I also tried adding
(setq load-path (cons "C:/Python25" load-path))
to my .emacs file but it didn't work.
Thanks all for the help.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Inferior Python Mode
2007-08-09 15:50 ` Matt
@ 2007-08-09 17:52 ` Stefan Monnier
0 siblings, 0 replies; 10+ messages in thread
From: Stefan Monnier @ 2007-08-09 17:52 UTC (permalink / raw)
To: help-gnu-emacs
> I also tried adding
> (setq load-path (cons "C:/Python25" load-path))
Sorry, I was half-asleep when I said it should work.
`load-path' is used to find Elisp packages. You want to modify `exec-path'
instead (which the path used to find external executables).
(setq exec-path (cons "C:/Python25" exec-path))
or
(add-to-list 'exec-path "C:/Python25")
The second option has the advantage that if "C:/Python25" is there already,
it won't be added a second time, which is good if you happen to
load&reload&rereload&... your .emacs file.
Stefan
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2007-08-09 17:52 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-07 6:35 Inferior Python Mode Matt
2007-08-07 9:08 ` Hadron
2007-08-07 14:48 ` Matt
2007-08-07 15:58 ` Sönmez Kartal
2007-08-07 16:25 ` Matt
2007-08-07 17:51 ` Sönmez Kartal
2007-08-08 14:53 ` Stefan Monnier
2007-08-09 15:50 ` Matt
2007-08-09 17:52 ` Stefan Monnier
2007-08-08 14:52 ` Stefan Monnier
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.