<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p><font size="+2">This is a variation of the many questions
complaining that one can't import exotic external modules, even
though the import works from the terminal. The many answers
suggest fixing the execute command in the Build screen. The
difference here is that I can't import a module from my own
machine, but that it works at both the terminal and Idle. I
suspect my problem is a PATH issue. Geany seems like a very
nice editor/IDE. But if I can't import even my own modules,
it's not very useful.<br>
</font></p>
<p><font size="+2">My simplified directory structure:</font></p>
<p><font size="+2">py - root for storing python MODULES (apps) and a
module of user defined functions (included in PYTHONPATH)</font></p>
<p><font size="+2">----| main</font></p>
<p><font size="+2"> main.py</font></p>
<p><font size="+2">----| common (for storing functions accessible by
multiple modules</font></p>
<p><font size="+2"> fun.py</font></p>
<p><font size="+2">The code:</font></p>
<p><font size="+2"><u>main.py</u></font></p>
<p><font size="+2">from common import fun</font></p>
<p><font size="+2">fun.test()<u><br>
</u></font></p>
<p><font size="+2"><u>fun.py</u></font></p>
<p><font size="+2">def test():</font></p>
<p><font size="+2"> print('testing')</font></p>
<p><font size="+2"><u>Ouput from Idle</u></font></p>
<p><font size="+2">========================== RESTART:
C:/py/test/main.py =========================<br>
testing<br>
>>> <u><br>
</u></font></p>
<p><font size="+2"><u>Output from Geany</u></font></p>
<p><br>
<font size="+2">ModuleNotFoundError: No module named 'py'
<br>
<br>
Original exception was:
<br>
Traceback (most recent call last):
<br>
File "test.py", line 1, in <module>
<br>
from py.common import fun
<br>
ModuleNotFoundError: No module named 'py' <br>
</font></p>
<p><font size="+2"><br>
</font></p>
<p><font size="+2"><u><br>
</u></font></p>
<p><font size="+2"><u><br>
</u></font></p>
</body>
</html>