Dear all,

apologies in advance if this is a typical newbie question: I am struggling 
somewhat with a sys.path related problem. I have my code packed up as a .egg 
file and installed on my development machine. The problem is that when I run 
tests from PyDev it is the installed version that is being used rather than the 
source code that I want to test. 

I naively thought that PyDev would make sure that src/ directory is in my 
sys.path before anything else I have installed but this does not seem to be the 
case:

--8<--
['/Users/avoss/bin/springsource/sts-2.6.1.SR1/plugins/org.python.pydev.debug_2.2.2.2011082312/pysrc',
 '/Library/Python/2.6/site-packages/euca2ools-1.2-py2.6.egg', 
'/Library/Python/2.6/site-packages/M2Crypto-0.20.2-py2.6-macosx-10.6-universal.egg',
 '/Library/Python/2.6/site-packages/Sphinx-1.0.7-py2.6.egg', 
'/Library/Python/2.6/site-packages/docutils-0.7-py2.6.egg', 
'/Library/Python/2.6/site-packages/Jinja2-2.5.5-py2.6.egg', 
'/Library/Python/2.6/site-packages/Pygments-1.4-py2.6.egg', 
'/Library/Python/2.6/site-packages/elvira-0.1-py2.6.egg', 
'/Library/Python/2.6/site-packages/pysnmp-4.1.16a-py2.6.egg', 
'/Library/Python/2.6/site-packages/pycrypto-2.3-py2.6-macosx-10.6-universal.egg',
 '/Library/Python/2.6/site-packages/pyasn1-0.0.13-py2.6.egg', 
'/Library/Python/2.6/site-packages/MySQL_python-1.2.3-py2.6-macosx-10.6-universal.egg',
 '/Library/Python/2.6/site-packages/setuptools-0.6c11-py2.6.egg', 
'/Library/Python/2.6/site-packages/MacFSEvents-0.2.1-py2.6-macosx-10.6-universal.egg',
 '/Users/avoss/Documents/workspace-sts/elvira/src', 
'/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python26.zip', 
'/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6', 
'/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-darwin',
 
'/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac',
 
'/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac/lib-scriptpackages',
 '/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python', 
'/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk',
 
'/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-old',
 
'/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload',
 
'/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/PyObjC',
 
'/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/wx-2.8-mac-unicode',
 '/Library/Python/2.6/site-packages/boto-1.9b-py2.6.egg', 
'/Library/Python/2.6/site-packages/pysvn', '/Library/Python/2.6/site-packages', 
'/Users/avoss/Documents/workspace-sts/elvira/src/test/elvira/taskrunner']
--8<--

As you can see, the sys.path contains the place where the PyDev python code 
lives, followed by stuff I have in my sites-packages directory, then src/ 
followed by standard modules that come with Pythong and finally the current 
directory. What's the best way to fix this?

Cheers,

Alex

---
Alexander Voss
Lecturer in Software Engineering
School of Computer Science
University of St Andrews
http://www.cs.st-andrews.ac.uk/~avoss
The University of St Andrews is a charity registered in Scotland : No SC013532


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Pydev-users mailing list
Pydev-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pydev-users

Reply via email to