Developing python code across subnet

Hi,

1st time here so I will apologize ahead of things if I happen to mess up protocol :frowning:
This may be more of a system issue than a python-specific one, but thought I’d start here…

I have 2 systems on my home subnet, 1 Win 10, 1 Fedora (31, at the moment). My code files reside on the Win 10 sys, but I also work on the files from the F31 sys occasionally. The systems have V3.8X (win 10) and 3.7 (F31) and I have pip’d in the necessary modules (i.e. PySerial, etc.).

I am using SublimeText3 on the F31 sys to access/edit files on my Win 10 sys and leave them there. What I’ve run into is that I have a module (actually, more than one) I created on the Win 10 sys referenced/imported in the code. On the Win 10 sys it is no problem. However, on the F31 sys I get an error that states no such module found.

My sense is it’s a path issue and that when executing from the F31 (on the F31’s Python install), it cannot see (and/or cannot find) the modules (located 1 directory down from the main code on the Win 10 sys).

Is there an easy and straightforward way of resolving this (without having to bring all the files over to the F31 sys)? Maybe I need to be more explicit on the path when importing to ensure the modules can be found?

Thanks in advance and cheers…

[Stepher]
“My sense is it’s a path issue and that when executing from the F31 (on
the F31’s Python install), it cannot see (and/or cannot find) the
modules (located 1 directory down from the main code on the Win 10
sys).”

Almost certainly it is a path issue. Start by copying and pasting the
actual error message you get, just to be clear about what is happening
and in case it is not what we think, but I expect it will be something
like this:

> import avocado
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named 'avocado'

Then compare sys.path from the F31 system and the Win10 system, they
are probably different.

An alternative explanation is that the paths are the same, but you are
executing code from different locations. Let’s say the modules you
cannot import are in the directory “M”, and “M” is not on the path on
either machine. Then the fact that F31 cannot see it is not surprising.
How does Win10 see it? Perhaps you have cd’ed into “M” and that explains
why the module is seen on the Win10 system.

Once you have confirmed that this is the issue that it seems to be, you
can confirm the solution by manually adjusting the F31 sys.path to
match the Win10 path, let’s say:

sys.path.append('path/to/M')
import avocado  # ought to succeed now

Once that works, then we can suggest some permanent fixes that avoids
having to manually adjust the path every single time.