

The solution was much more simple than I thought. In 'main.py' I had tried unsuccessfully all the combinations bellow: from Booklet import Question In my case i had the structure below: Booklet I had the same problem (Python 2.7 Linux), I have found the solution and i would like to share it.

Python should now find and load the modules you specified. So it doesn't just look in your current directory, but in all the directories that are in your current directory).Īfter you've set your PYTHONPATH in the step above, run your module from your current directory (the toolkit directory). This sets your PYTHONPATH to ".", which basically means that your PYTHONPATH will now look for any called files within the directory you are currently in, (and more to the point, in the sub-directory branches of the directory you are in.
#MACJOURNAL IMPORT .JMX CODE#
When you are in the toolkit directory, enter this line of code on your command line: Which in this case is the toolkit directory. In this case, you would go to the directory that contains paths to both those files (or in other words, the closest directory that the paths of both those files share). In this case, you're trying to run the mountain.py file, and trying to call the module, which are in separate directories. Since I run Ubuntu, this is what I did)Ĭhange directory (cd) to the directory above the directory where your files are. (NOTE: From your initial post, I am assuming you are using an *NIX-based machine and are running things from the command line, so this advice is tailored to that.

What I did, and what I recommend, is to try this: But I was able to get it to work in the end. I ran into something very similar when I did this exercise in LPTHW I could never get Python to recognise that I had files in the directory I was calling from.
