Re: import problems.

2012-01-11 Thread Antoon Pardon
On 01/11/2012 03:45 PM, Antoon Pardon wrote: On 01/11/2012 02:57 PM, Peter Otten wrote: Antoon Pardon wrote: I have an import problem I can't figure out. I am using python 2.6.6 on a debian box In one directory (pylib) I have a file misc.py and the file testutil.py. from misc import Rec

Re: import problems.

2012-01-11 Thread Antoon Pardon
On 01/11/2012 02:57 PM, Peter Otten wrote: Antoon Pardon wrote: I have an import problem I can't figure out. I am using python 2.6.6 on a debian box In one directory (pylib) I have a file misc.py and the file testutil.py. from misc import Rec ImportError: cannot import nam

Re: import problems.

2012-01-11 Thread Peter Otten
Antoon Pardon wrote: > I have an import problem I can't figure out. > I am using python 2.6.6 on a debian box > > In one directory (pylib) I have a file misc.py and > the file testutil.py. > from misc import Rec > ImportError: cannot import name Rec > > Why can I import Rec from misc in te

Re: import problems.

2012-01-11 Thread Dave Angel
On 01/11/2012 08:21 AM, Antoon Pardon wrote: I have an import problem I can't figure out. I am using python 2.6.6 on a debian box In one directory (pylib) I have a file misc.py and the file testutil.py. testutil.py -- print "in", __name__ from misc imp

Re: Import Problems

2007-04-27 Thread Robert Kern
Bill Jackson wrote: > Once again, I am having issues with imports... > > Until now, I thought the general guidelines were to rarely use 'from x > import y' syntax, except when you really want to copy names over. No, the guideline is to not use "from x import *" except at the interactive prompt

Re: Import Problems

2007-04-27 Thread Bill Jackson
Bill Jackson wrote the following on 04/27/2007 12:49 PM: > # importtest/test2/__init__.py > from someclass import * > from test2 import * Sorry typo here: # importtest/test2/__init__.py from someclass import * from mytest import * -- http://mail.python.org/mailman/listinfo/python-list

Re: import problems in packages

2005-09-28 Thread Peter Otten
Stéphane Ninin wrote: > Also sprach Stéphane Ninin : Sollte es denn möglich sein! Dieser alte Heilige hat in seinem Walde noch Nichts davon gehört... that intra-package import takes precedence over absolute import! > Here is the basic structure of the code (I have reduced it first). And nicely

Re: import problems in packages

2005-09-28 Thread Peter Hansen
Stéphane Ninin wrote: > Traceback (most recent call last): > File "main.py", line 8, in ? > main() > File "main.py", line 5, in main > handler = HandlerFactory().makeHandler(command) > File "c:\ROOT\Handlers\HandlerFactory.py", line 6, in HandlerFactory > import Handlers.Default.H

Re: import problems in packages

2005-09-28 Thread St�phane Ninin
Also sprach Stéphane Ninin : > > > ... when I start main.py, I get: > > Traceback (most recent call last): > File "main.py", line 8, in ? > main() > File "main.py", line 5, in main > handler = HandlerFactory().makeHandler(command) > File "c:\ROOT\Handlers\HandlerFactory.py", line

Re: import problems *newbie*

2005-01-17 Thread Steve Holden
Grig Gheorghiu wrote: In my experience (as a tester), it is easier to deal with PYTHONPATH than to add the my.pth file to the site-packages directory. The main reason is that I have my custom packages and modules in a directory tree that I deploy on many clients/servers/platforms/OS versions, some

Re: import problems *newbie*

2005-01-16 Thread Grig Gheorghiu
In my experience (as a tester), it is easier to deal with PYTHONPATH than to add the my.pth file to the site-packages directory. The main reason is that I have my custom packages and modules in a directory tree that I deploy on many clients/servers/platforms/OS versions, some running different vers

Re: import problems *newbie*

2005-01-16 Thread mike kreiner
Thanks for your help Steve and F. Petitjean. Sorry for taking so long to get back, I was away from my lab for a few days. The path to my directory was not included in the sys.path list. Adding a my.pth file to the site-packages directory fixed the import problem. F. Petitjean, I originally edited

Re: import problems *newbie*

2005-01-14 Thread Steve Holden
F. Petitjean wrote: Le 13 Jan 2005 21:58:36 -0800, mike kreiner a écrit : I am having trouble importing a module I created. I'm running PythonWin on Windows XP if that helps. I saved my module in a folder called my_scripts in the site-packages directory. I edited the python path to include the my_s

Re: import problems *newbie*

2005-01-14 Thread F. Petitjean
Le 13 Jan 2005 21:58:36 -0800, mike kreiner a écrit : > I am having trouble importing a module I created. I'm running PythonWin > on Windows XP if that helps. I saved my module in a folder called > my_scripts in the site-packages directory. I edited the python path to > include the my_scripts folde