3 ms·
It was probably something I did. The original tutorial I followed had everything in one file and didn't get into anything about imports. I started splitting eve
by grawprog 5y ago
It was probably something I did. The original tutorial I followed had everything in one file and didn't get into anything about imports. I started splitting everything up arbitrarily and started tossing imports into the files that complained about missing dependencies and ended up getting overwhelmed because nothing worked.
I'm sure if I'd taken the time to try and fix it I eventually could have and at this point i've had more experience with a bunch of different languages, so I'm sure it's not as bad as I remember.
I imagine it's one of those cases where if i were to go back and laugh about how stupid I was, but ya know, those first impressions.
- trulyme 5y agoNo, your impression was right. Reading this blog post made me realize how little I know about the python import system (and I use python daily), and at the same time how little I want to learn it. It is completely unintuitive and probably one of the worst aspects of otherwise beautiful and useful language. Fortunately, sys.path hack works reliably - one can just add that one line and imports work as expected.
- mixmastamyk 5y agoThere's only about three things to learn at first. If you know how a path and relative path work from the shell, there is only one thing: touch __init__.py. These are on the import doc page and beginners tutorial. https://docs.python.org/3/tutorial/modules.html#packages https://docs.python.org/3/tutorial/modules.html#packages