ActiveState: PythonWin not using PythonPath for import? 
Author Message
 ActiveState: PythonWin not using PythonPath for import?

I made a folder just below the python root to hold my own code.

In PythonWin, I edited PythonPath, adding my folder to the end of the
value.

Yet when I use "import aFunction" when "aFunction.py" is within my
folder, I get an error. When I move the file up to the Python root
folder, it works.

What the heck is going on? I've quit, rebooted, etc. PythonWin still
shows the intended PythonPath value when I go to edit it again. But
it's not affecting how things work....

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Mon, 19 May 2003 03:00:00 GMT  
 ActiveState: PythonWin not using PythonPath for import?

Quote:

> I made a folder just below the Python root to hold my own code.

> In PythonWin, I edited PythonPath, adding my folder to the end of the
> value.

> Yet when I use "import aFunction" when "aFunction.py" is within my
> folder, I get an error. When I move the file up to the Python root
> folder, it works.

The "root" PYTHONPATH entry is the core PythonPath, and is only used if
Python can not locate its core library etc manually.

Add your path to one of the subkeys, or just add your own subkey and add
your value there...

Mark.



Wed, 21 May 2003 08:11:24 GMT  
 ActiveState: PythonWin not using PythonPath for import?


Quote:

> > I made a folder just below the Python root to hold my own code.

> > In PythonWin, I edited PythonPath, adding my folder to the end of
the
> > value.

> > Yet when I use "import aFunction" when "aFunction.py" is within my
> > folder, I get an error. When I move the file up to the Python root
> > folder, it works.

> The "root" PYTHONPATH entry is the core PythonPath, and is only used
if
> Python can not locate its core library etc manually.

> Add your path to one of the subkeys, or just add your own subkey and
add
> your value there...

Thanks, that worked (once I quit/relaunched PythonWin). Is this (a)
recognized outside PythonWin, and (b) documented?

Sent via Deja.com http://www.deja.com/
Before you buy.



Fri, 23 May 2003 03:00:00 GMT  
 ActiveState: PythonWin not using PythonPath for import?

Quote:

> Thanks, that worked (once I quit/relaunched PythonWin). Is this (a)
> recognized outside PythonWin, and (b) documented?

Yes, and somewhere, but almost certainly not as prominently as it should be.

Mark.



Sat, 24 May 2003 13:16:28 GMT  
 ActiveState: PythonWin not using PythonPath for import?
If you edit the Pythonwin path, that should solve your problem.

Christian



Quote:



> > > I made a folder just below the Python root to hold my own code.

> > > In PythonWin, I edited PythonPath, adding my folder to the end of
> the
> > > value.

> > > Yet when I use "import aFunction" when "aFunction.py" is within my
> > > folder, I get an error. When I move the file up to the Python root
> > > folder, it works.

> > The "root" PYTHONPATH entry is the core PythonPath, and is only used
> if
> > Python can not locate its core library etc manually.

> > Add your path to one of the subkeys, or just add your own subkey and
> add
> > your value there...

> Thanks, that worked (once I quit/relaunched PythonWin). Is this (a)
> recognized outside PythonWin, and (b) documented?

> Sent via Deja.com http://www.deja.com/
> Before you buy.

Sent via Deja.com http://www.deja.com/
Before you buy.


Thu, 29 May 2003 07:43:18 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. import from file not on the PYTHONPATH

2. pythonwin using COM import pythoncom error

3. PYTHONPATH and Pythonwin Question

4. PYTHONPATH setting under Windows - and search for Pythonwin docs

5. Pythonwin Browse PythonPath and Idle Path Browser shows different content

6. PythonWin - ActiveState 2.2.2 - problem

7. Importing a file that isn't in the pythonpath

8. Documentation for importing modules / pythonpath?

9. Not finding user-installed module despite PYTHONPATH!

10. why does activestate (win98) python not support globbing

11. http://tcl.activestate.com/software/mac/macFAQ.html not available

12. cmdline.py not working in ActiveState Python 2.1

 

 
Powered by phpBB® Forum Software