[Biopython-dev] Accessing built-in data files

Peter biopython at maubp.freeserve.co.uk
Mon Nov 19 15:52:14 UTC 2007

Tiago Antão wrote:
>> I may be naive here, but I would expect the datafiles to be installed in
>> the same relative path as the python files.  Is this not always the case?
> Yep, but which datafiles and where? By which I mean, platform
> dependent or platform independent. Again this is mainly a not issue.
> But "where" is important. "Where" might be the system path and all is
> fine and dandy, but it also might be elsewhere (In my case, when
> testing I don't install to the system path. Also, if you don't have
> admin access to the machine...)

If the data files are installed the data subdirectory of where your 
python are, can't your python files just load them using a relative path?

e.g. On Windows, using Python 2.3 (from memory) the files should go:


On my linux machine, where I have installed Biopython under my home 
directory (rather than system wide):


If I had installed Biopython using admin access, it might be:


In all those cases, one of your SimCoal python files just needs to open 
its data files using a relative path, for example "data/island.par".

For comparison, the EUtils DTD files did end up here as I expected:


Am I missing something?


More information about the Biopython-dev mailing list