1

My python file is in the folder 'RealData/Python/run.py' What I need to do in run.py is to import another python file: plot_ensembles.py which is in the folder 'RealData/convolution/plot_ensembles.py'

My code returns an error:

import sys
sys.path.append( 'myname/Documents/RealData/convolution')
import plot_ensembles

ImportError: No module named 'plot_ensembles'

Probably this is a stupid mistake...

Simmias
  • 55
  • 7

1 Answers1

1

You can try In the file that has the script, you want to do something like this:

import sys
sys.path.append(os.path.realpath('../convolution'))
import plot_ensembles
Rajarshi Das
  • 11,778
  • 6
  • 46
  • 74