0

I am trying to run a program which it specification say for python 2.6 I am running it with python 2.6.6, so it should work but I found that the importation fails see this question, and this sample:

from rnaspace.dao.storage_configuration_reader import storage_configuration_reader

This is due to a version change (I doubt) or of some of the environment on the original server? A solution is in the question cited, but I there is another way to solve this problem that it doesn't involve to change each file with this kind of importation?

Community
  • 1
  • 1
llrs
  • 3,308
  • 35
  • 68

1 Answers1

1

Your import statement assumes python knows where the 'rnaspace' package is. Maybe you need to add the path to the package rnaspace in your include path?

    import sys

    pathToRnaspace = "/path/to/the/rnaspace/package"
    sys.path.append(pathToRnaspace)

    from rnaspace.core.putative_rna import putative_rna
Tejas Pendse
  • 551
  • 6
  • 19
  • Works but this implies that I must do it for each file of the program to work well... – llrs Feb 25 '14 at 11:57
  • 1
    I don't see how you can avoid that, I'm afraid. Each file would need to import the packages it uses. I'd love to know if there is a way, if I'm wrong! – Tejas Pendse Feb 25 '14 at 12:07