<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE></TITLE>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18876"></HEAD>
<BODY><!-- Converted from text/plain format -->
<P><BR><BR><FONT size=2>> -----Original Message-----<BR>> From: Dave Angel
[</FONT><A href="mailto:davea@ieee.org"><FONT
size=2>mailto:davea@ieee.org</FONT></A><FONT size=2>]<BR>> Sent: Tuesday,
March 16, 2010 5:04 PM<BR>> To: Barak, Ron<BR>> Cc: Pablo Recio Quijano;
python-list@python.org<BR>> Subject: RE: How to add a library path to
pythonpath ?<BR>><BR>><BR>><BR>> Barak, Ron wrote:<BR>> >
Thanks for the suggestion Pable.<BR>> ><BR>> > However, I really
need the $PYTHONPATH to include this<BR>> additional library, so all Python
scripts could use it.<BR>> ><BR>> > In Windows I have defined
PYTHONPATH as<BR>> > c:\views\cc_view\TS_svm_ts_tool\SVMInspector\lib\,
and also in the<BR>> > Windows registry I have<BR>> ><BR>>
><BR>> HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\version\PythonPath\
as<BR>> ><BR>>
C:\Python26\Lib;C:\Python26\DLLs;C:\views\cc_view\TS_svm_ts_tool\SVMIn<BR>>
> spector\lib\;C:\Python26\Lib\lib-tk;<BR>> ><BR>> > However,
even with all the above, the SVMInspecor modules<BR>> are not found.<BR>>
><BR>> > <BR>> See my response at the end.
Top-posting makes for a very<BR>> confusing thread.<BR>> >
<snip><BR>> ><BR>> > 2010/3/16 Barak, Ron
<Ron.Barak@lsi.com<</FONT><A href="mailto:Ron.Barak@lsi.com"><FONT
size=2>mailto:Ron.Barak@lsi.com</FONT></A><FONT size=2>>><BR>>
><BR>> > Hi,<BR>> ><BR>> > I'm trying to add a library path
to my pythonpath, but<BR>> seems it is not<BR>> > accepted -<BR>>
><BR>> > On Windows DOS window:<BR>> ><BR>> > C:\>echo
%PYTHONPATH%<BR>> >
c:\views\cc_view\TS_svm_ts_tool\SVMInspector\lib\<BR>> ><BR>> >
C:\>python -c "import sys ; print sys.path"<BR>> > ['',
'c:\\views\\cc_view\\TS_svm_ts_tool\\SVMInspector\\lib',<BR>> >
'C:\\WINDOWS\\syst em32\\python26.zip', 'C:\\Python26\\DLLs',<BR>> >
'C:\\Python26\\lib', 'C:\\Python26\\l ib\\plat-win',<BR>> >
'C:\\Python26\\lib\\lib-tk', 'C:\\Python26', 'C:\\Python26\\lib\\<BR>> >
site-packages',<BR>> >
'C:\\Python26\\lib\\site-packages\\wx-2.8-msw-unicode']<BR>> ><BR>>
> C:\><BR>> ><BR>> > On Windows cygwin:<BR>> ><BR>>
> $ echo $PYTHONPATH<BR>> >
.:/cygdrive/c/views/cc_view/TS_svm_ts_tool/SVMInspector/lib/<BR>>
><BR>> > $ python -c "import sys ; print sys.path"<BR>> >
['',<BR>> ><BR>>
'.:\\cygdrive\\c\\views\\cc_view\\TS_svm_ts_tool\\SVMInspector\\lib',<BR>>
> 'C:\\WINDOWS\\system32\\python26.zip', 'c:\\Python26\\DLLs',<BR>> >
'c:\\Python26\\lib', 'c:\\Python26\\lib\\plat-win',<BR>> >
'c:\\Python26\\lib\\lib-tk', 'c:\\Python26',<BR>> >
'c:\\Python26\\lib\\site-packages',<BR>> >
'c:\\Python26\\lib\\site-packages\\wx-2.8-msw-unicode']<BR>> ><BR>>
> $<BR>> ><BR>> > What am I doing wrong ?<BR>> ><BR>>
> Thanks,<BR>> > Ron.<BR>> ><BR>> ><BR>>
> <BR>> In your original message, what you displayed worked
exactly<BR>> as expected. As you didn't say what made you think
something<BR>> was wrong, I ignored the message.<BR>><BR>> Now, you say
that some modules are not found. So how about<BR>> giving some more
specifics so someone can actually debug the<BR>> problem. Pick a
particular module, tell us the complete path<BR>> to that module, and show us
both the sys.path strings (which<BR>> look correct for the Windows case, and
of course bogus for<BR>> the cygwin case), as well as the offending import
statement<BR>> and its traceback.<BR>><BR>> DaveA<BR><BR>Hi
Dave,<BR><BR>My Python is the Windows Python (I need this for
wxPython):<BR><BR></FONT><FONT size=2><FONT face="Courier New">$ ls -ls `which
python`<BR>1 lrwxrwxrwx 1 rbarak mkgroup-l-d 31 Mar 4 14:02
/usr/bin/python -> /cygdrive/c/Python26/python.exe<BR></FONT><BR>Here's a
demo script:<BR><BR></FONT><FONT size=2><FONT color=#0000ff
face="Courier New">#!/usr/bin/env python<BR><BR>import sys<BR>print
"\n",sys.path,"\n"<BR><BR>from ErrorManager.ErrorManager import
ErrorManager<BR></FONT><BR>And it's run produces:<BR><BR></FONT><FONT
size=2><FONT face="Courier New">$ python -u
tmp.py<BR><BR>['c:\\views\\cc_view\\TS_svm_ts_tool\\svm_ts_tool',
'.:\\cygdrive\\c\\views\\cc_view\\TS_svm_ts_tool\\SVMInspector\\lib',
'C:\\WINDOWS\\system32\\python26.zip', 'c:\\Python26\\DLLs',
'c:\\Python26\\lib', 'c:\\Python26\\lib\\plat-win', 'c:\\Python26\\lib\\lib-tk',
'c:\\Python26', 'c:\\Python26\\lib\\site-packages',
'c:\\Python26\\lib\\site-packages\\wx-2.8-msw-unicode']<BR><BR>Traceback (most
recent call last):<BR> File "tmp.py", line 6, in
<module><BR> from ErrorManager.ErrorManager import
ErrorManager<BR>ImportError: No module named
ErrorManager.ErrorManager<BR></FONT><BR></FONT><FONT size=2><FONT
face="Courier New">$ ls -ls
/cygdrive/c/views/cc_view/TS_svm_ts_tool/SVMInspector/lib/ErrorManager/ErrorManager.py<BR>4
-rwxr-xr-x 1 rbarak ???????? 1843 Sep 21 19:16
/cygdrive/c/views/cc_view/TS_svm_ts_tool/SVMInspector/lib/ErrorManager/ErrorManager.py<BR><BR>$
grep ErrorManager
/cygdrive/c/views/cc_view/TS_svm_ts_tool/SVMInspector/lib/<BR>ErrorManager/ErrorManager.py<BR>class
ErrorManager:<BR><BR>$ echo
$PYTHONPATH<BR>.:/cygdrive/c/views/cc_view/TS_svm_ts_tool/SVMInspector/lib/<BR></FONT><BR>Please
let me know if the above is enough, or you'd like to see the results from a
Windows' DOS window.</FONT></P>
<P><FONT size=2>Thanks,<BR>Ron.</FONT> </P></BODY></HTML>