[BioPython] IOError: [Errno 2] No such file or directory:

Peter biopython at maubp.freeserve.co.uk
Sun Mar 4 11:58:07 UTC 2007


Hossein Shahsavari wrote:
> Hello,
> 
> I receive the following error when I am trying to access a file called HISTORY
> in an another file by this command
> 
> template = '~/CSH/HISTORY'
> 
> and I get this error.
> 
> IOError: [Errno 2] No such file or directory: '~/CSH/HISTORY'
> 
> I use python in Linux environment. I appreciate any suggestions/comments.

If you have posted the python code it would be easier to guess what is 
going wrong.  What does this do?

import os
template = '~/CSH/HISTORY'
print os.path.isfile(template)

That should print either True or False.

You might also try replacing the tilde ('~') with the actual path of 
your home folder, something like this typically:

template = '/home/username/CSH/HISTORY'

P.S. Have you checked the case?  Linux and Unix are case sensitive.

Peter




More information about the Biopython mailing list