SAME-Project / same-project

https://sameproject.ml/
Apache License 2.0
20 stars 8 forks source link

Python relative importing? #160

Open aronchick opened 2 years ago

aronchick commented 2 years ago

Curious why this doesn't work?

❯ python3 sameproject/main.py -t aml -f test/ops/testdata/same_notebooks/generic/same.yaml
Traceback (most recent call last):
  File "sameproject/main.py", line 1, in <module>
    from sameproject.cli import run, version, init, verify
ModuleNotFoundError: No module named 'sameproject'
Bubblyworld commented 2 years ago

Most likely you're running the command in a python context that doesn't have the sameproject module installed, right? If you ran in a poetry shell or pip install sameproject then I think this would work.

We could use relative imports for everything, not sure what is better practice? Shouldn't make a difference for an end-user either way I think.