srakastyle.blogg.se

Subpackage not found in texstudio
Subpackage not found in texstudio







subpackage not found in texstudio subpackage not found in texstudio

For the solution to be clean, it has to be local only. I don't want to rely on sys.path, to avoid global side effects, nor on *.pth files, which are just another way to play with sys.path with the same global effets.Unless I was totally wrong somewhere, this will leave me with a feeling something is really broken in Python's model of package and sub‑packages. Sorry for the hard words, but that's two days I trying to work around this stupid‑like behavior. So you are either forced to use the overkill prefix all the time or use the unsafe way as in version #1 and disallowed by Python to use the safe handy way? The better way, which is safe and avoid unecessary long prefix is the only one which Python reject? Is this because it loves import * or because it loves overlong prefixes (which does not help to enforce this practice)?. uh Version 3 # file test.py v3įrom import attribute1 So that's a module, but that's not a module /-P 8-O. Version 2 # file test.pyįrom package.subpackage import module # AlternativeĪ safer way to import, item by item, but it fails, Python don't want this: fails with the message: "No module named module". That's the bad and unsafe way of importing things (import all in a bulk), but it works. Content of module.py # file `package/subpackage/module.py`Ĭontent of test.py (3 versions) Version 1 # file test.py

subpackage not found in texstudio

Here is… Directory layout dirīoth package/_init_.py and package/subpackage/_init_.py are empty. Having already use flat packages, I was not expecting the issue I encountered with nested packages.









Subpackage not found in texstudio