<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>I started Geany from the Ubunto menu.<br>
</p>
<p>I ran:</p>
<p><b>import sys</b></p>
<p><b>print(sys.path)</b></p>
<p>First I tried Geany and got</p>
<p><b>/tmp/geany_run_script_UR8SC0.sh: 7: ./sys: Permission denied</b><b><br>
</b><b>------------------</b><b><br>
</b><b>(program exited with code: 126)</b></p>
<p>Then I tried Idle and got</p>
<p><b>['/home/paul/py/test', '/home/paul', '/usr/bin',
'/usr/lib/python37.zip', '/usr/lib/python3.7',
'/usr/lib/python3.7/lib-dynload',
'/home/paul/.local/lib/python3.7/site-packages',
'/usr/local/lib/python3.7/dist-packages',
'/usr/lib/python3/dist-packages']</b><br>
</p>
<div class="moz-cite-prefix">From the terminal I got</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix"><b>['', '/usr/lib/python37.zip',
'/usr/lib/python3.7', '/usr/lib/python3.7/lib-dynload',
'/home/paul/.local/lib/python3.7/site-packages',
'/usr/local/lib/python3.7/dist-packages',
'/usr/lib/python3/dist-packages']</b></div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">I think I see the problem. Python is
looking in <b><br>
</b></div>
<div class="moz-cite-prefix"><b><br>
</b></div>
<div class="moz-cite-prefix"><b>/home/paul/.local/lib/python3.7/site-packages</b></div>
<div class="moz-cite-prefix"><b><br>
</b></div>
<div class="moz-cite-prefix">but I was sure I added <br>
<b><b><br>
</b></b></div>
<div class="moz-cite-prefix"><b><b>/home/paul/py</b></b></div>
<div class="moz-cite-prefix"><b><b><br>
</b></b></div>
<div class="moz-cite-prefix">to PYTHONPATH</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">How can I change the path? An a
rhetorical question. Why is Idle smarter?<br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">Thank you for your response.</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">Paul</div>
<div class="moz-cite-prefix"><b><b>=======================================================================<br>
</b></b></div>
<div class="moz-cite-prefix"><b><b><br>
</b></b></div>
<div class="moz-cite-prefix">On 12/14/19 8:28 AM, Georg Klingenberg
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:22B013E3F7D34077A83426597DF8566E@GeorgePC">an whilst you
are at it set up a virtual environment (venv) to keep the versions
nicely apart (batteries are included);
<br>
in Geany, each environment corresponds to a particular project
(with its respective settings)..
<br>
<br>
-----Original Message----- From: Lex Trotman
<br>
Sent: Friday, December 13, 2019 10:22 PM
<br>
To: Geany general discussion list
<br>
Subject: Re: [Geany-Users] Can't import local module
<br>
<br>
How are you starting Geany? Its possible you are starting it in a
way
<br>
that PYTHONPATH is not set. Perhaps test it by running a small
Python
<br>
program with Geany to print sys.path.
<br>
<br>
Cheers
<br>
Lex
<br>
<br>
On Sat, 14 Dec 2019 at 02:54, paul Marlin
<a class="moz-txt-link-rfc2396E" href="mailto:wurfsendungen@biketrain.net"><wurfsendungen@biketrain.net></a> wrote:
<br>
<blockquote type="cite">
<br>
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>
<br>
My simplified directory structure:
<br>
<br>
py - root for storing python MODULES (apps) and a module of user
defined functions (included in PYTHONPATH)
<br>
<br>
----| main
<br>
<br>
main.py
<br>
<br>
----| common (for storing functions accessible by multiple
modules
<br>
<br>
fun.py
<br>
<br>
The code:
<br>
<br>
main.py
<br>
<br>
from common import fun
<br>
<br>
fun.test()
<br>
<br>
fun.py
<br>
<br>
def test():
<br>
<br>
print('testing')
<br>
<br>
Ouput from Idle
<br>
<br>
========================== RESTART: C:/py/test/main.py
=========================
<br>
testing
<br>
>>>
<br>
<br>
Output from Geany
<br>
<br>
<br>
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>
<br>
<br>
<br>
<br>
_______________________________________________
<br>
Users mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.geany.org">Users@lists.geany.org</a>
<br>
<a class="moz-txt-link-freetext" href="https://lists.geany.org/cgi-bin/mailman/listinfo/users">https://lists.geany.org/cgi-bin/mailman/listinfo/users</a>
<br>
</blockquote>
_______________________________________________
<br>
Users mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.geany.org">Users@lists.geany.org</a>
<br>
<a class="moz-txt-link-freetext" href="https://lists.geany.org/cgi-bin/mailman/listinfo/users">https://lists.geany.org/cgi-bin/mailman/listinfo/users</a> <br>
_______________________________________________
<br>
Users mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.geany.org">Users@lists.geany.org</a>
<br>
<a class="moz-txt-link-freetext" href="https://lists.geany.org/cgi-bin/mailman/listinfo/users">https://lists.geany.org/cgi-bin/mailman/listinfo/users</a>
<br>
</blockquote>
</body>
</html>