how to load file into interpreter(python)?
  Home FAQ Contact Sign in
gnu.emacs.help only
 
Advanced search
POPULAR GROUPS

more...

gnu.emacs.help Profile…
 Up
how to load file into interpreter(python)?         


Author: cnb
Date: Sep 15, 2008 11:58

Python-mode worked right out out of the box in Emacs and then I added
Python to my path so now the interpreter works as well.

However when I try to load a file(that is not located in site-
packages) it doesn't work.
>>> Traceback (most recent call last):

ImportError: No module named parsing

It is fairly impractical to work with if that doesn't work and cut and
pasting doesn't work(not that it is a good alternative in the first
place) because of Python being intendation-sensitive.

Can I add something to my .emacs-file to solve this?
5 Comments
Re: how to load file into interpreter(python)?         


Author: Oleksandr Gavenko
Date: Sep 15, 2008 14:06

On C-c C-l I get same error as you if load file from other dir
then firstly loaded.

Value of
import sys
print sys.path
get me some like
['', ..., 'e:\\bin\\python'].

Interpreter search import in this dirs.
How change it with working emacs I don't know.

Try eval file by C-c C-c (work from any dirs, but you must
sequentially load file to satisfy depends), there are many wrong.

Emacs and Python still badly friend (bed integration).
no comments
Re: how to load file into interpreter(python)?         


Author: Thierry Volpiatto
Date: Sep 15, 2008 15:01

cnb writes:
> Python-mode worked right out out of the box in Emacs and then I added
> Python to my path so now the interpreter works as well.

What do you use ?
python-mode.el or python.el .
> However when I try to load a file(that is not located in site-
> packages) it doesn't work.
>>>> Traceback (most recent call last):
>
> ImportError: No module named parsing

All the modules you load have to be:

in your PYTHONPATH

or

in current directory
Show full article (0.85Kb)
no comments
Re: how to load file into interpreter(python)?         


Author: cnb
Date: Sep 16, 2008 03:07

C:/Python25/;C:/Python25/Progs;

thos eare in my windows load path.

(setq load-path (cons "C:/Python25/" load-path))

(setq load-path (cons "C:/Python25/Progs/NetFlixRecSys/parsing.py"
load-path))

if I add soemthing like C:/somedir then everything in somedir is in my
loadpath? because i have C:/Python25/Progs/Netflix/parsing.py and it
doesn't load.
no comments
Re: how to load file into interpreter(python)?         


Author: cnb
Date: Sep 16, 2008 03:08

im using the default python mode in latest emacs.
no comments
Re: how to load file into interpreter(python)?         


Author: cnb
Date: Sep 16, 2008 03:26

even when using import/reload file from the emacs-python-menu and
choosing the file in the windows-GUI, thus giving the whole path I
still get the same error.
no comments