Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python

set PYTHONPATH for a directory?

 

 

Python python RSS feed   Index | Next | Previous | View Threaded


ndbecker2 at gmail

May 4, 2012, 5:21 AM

Post #1 of 3 (276 views)
Permalink
set PYTHONPATH for a directory?

I'm testing some software I'm building against an alternative version of a
library. So I have an alternative library in directory L. Then I have in an
unrelated directory, the test software, which I need to use the library version
from directory L.

One approach is to set PYTHONPATH whenever I run this test software. Any
suggestion on a more foolproof approach?

--
http://mail.python.org/mailman/listinfo/python-list


d at davea

May 4, 2012, 6:46 AM

Post #2 of 3 (254 views)
Permalink
Re: set PYTHONPATH for a directory? [In reply to]

On 05/04/2012 08:21 AM, Neal Becker wrote:
> I'm testing some software I'm building against an alternative version of a
> library. So I have an alternative library in directory L. Then I have in an
> unrelated directory, the test software, which I need to use the library version
> from directory L.
>
> One approach is to set PYTHONPATH whenever I run this test software. Any
> suggestion on a more foolproof approach?
>
Simply modify sys.path at the beginning of your test software. That's
where import searches.



--

DaveA

--
http://mail.python.org/mailman/listinfo/python-list


pedro.larroy.lists at gmail

May 4, 2012, 7:04 AM

Post #3 of 3 (253 views)
Permalink
Re: set PYTHONPATH for a directory? [In reply to]

Isn't virtualenv for this kind of scenario?


Pedro.

On Fri, May 4, 2012 at 3:46 PM, Dave Angel <d [at] davea> wrote:
> On 05/04/2012 08:21 AM, Neal Becker wrote:
>> I'm testing some software I'm building against an alternative version of a
>> library.  So I have an alternative library in directory L.  Then I have in an
>> unrelated directory, the test software, which I need to use the library version
>> from directory L.
>>
>> One approach is to set PYTHONPATH whenever I run this test software.  Any
>> suggestion on a more foolproof approach?
>>
> Simply modify  sys.path  at the beginning of your test software.  That's
> where import searches.
>
>
>
> --
>
> DaveA
>
> --
> http://mail.python.org/mailman/listinfo/python-list
--
http://mail.python.org/mailman/listinfo/python-list

Python python RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.