Ex25 - Select folder in python interpreter

Hi all, trying out this busy forum for the first time, seeking help.

On “import ex25” i receive a “ModuleNotFoundError: No module named ‘ex25’” from the python interpreter.
I suspect the whereabouts of this file aren’t clear to python. How can i specify that in the interpreter (ie not powershell)?

Hi ray,

It looks like you can do this:

import os
os.chdir(path)

But its worth reading about the constraints here.

Probably less hassle to navigate to the location of the file and open the interpreter from there.

1 Like

From the error, it looks as if you were not in the subdirectory that contains ex25.py when you started the python interpreter. If you’re going to import your own module (not one from the Python Library), the simplest way is to be in the subdirectory that contains your module when you start the interpreter.

2x thanks - i ended up running python WITHIN powershell, where the problem didn’t occur. Before i had used a stand-alone python

Hey @ray, can you explain “used a stand-alone python”? I’ve not heard of that before.

Stand-alone is meant to mean a separate window, where python.exe runs on its own (started via windows 10 python tile) - in contrast to running it in the powershell by keying in ‘python’ (as you are advising in the video25).
Not sure now whether this qualifies for the term ‘stand-alone’ …

Can you do me a screenshot of this stand-alone python? I’ve actually never seen this so I’m not sure how you’re getting to it. I’ll probably have to warn people off of it.

Is that IDLE that gets installed with the code/libraries? I’ve never opened it too look.

Tile directs to python.exe and opens that window. The small similar looking tile below Atom is IDLE, leads to pythonw.exe (sic). Haven’t tried that out, too.

Ahhhhh ok so that’s just starting cmd.exe (older PowerShell) with Python ready to go. That’s not nearly as useful as using PowerShell so just keep using powershell from now on.

Ok, great, thanks for sharing this, I’ll know from now on :slight_smile: