jeffsf / pyDE1

Controller for the Decent Espresso DE1
GNU General Public License v3.0
77 stars 16 forks source link

[v0.4.0] Odd problem with ugly_bits import #3

Closed a112358132134 closed 3 years ago

a112358132134 commented 3 years ago

When running run.py from the current git clone of v0.4.0, I receive the following error:

ModuleNotFoundError: No module named 'ugly_bits'

To fix this, I adjusted line 19 in controller.py from this:

from ugly_bits import manual_setup

to this:

from pyDE1.ugly_bits import manual_setup

Apologies for not understanding python - I doubt this is the correct way to address this. Any feedback would be welcome - thank you.

jeffsf commented 3 years ago

I can't say that I'm an expert with Python's module-resolution path.

At least as I poorly understand it, it should look at sys.path in resolution. https://docs.python.org/3/library/sys.html#sys.path

I was under the impression that an unqualified name for the module would allow one to use a local override without having to edit the supplied one. I'll look into it as I'd like to use a similar construct for being able to locally override the settings.

Edit:

Looks like pyCharm is helpfully modifying the path, adding

/path/to/pyDE1/src/pyDE1
/path/to/pyDE1
/path/to/pyDE1/src

to sys.path