pnpnpn / dna2vec

dna2vec: Consistent vector representations of variable-length k-mers
MIT License
182 stars 60 forks source link

installation/training fails unless run from scripts folder #4

Closed stanleyjs closed 7 years ago

stanleyjs commented 7 years ago
$ python3 ./scripts/train_dna2vec.py -c configs/small_example.yml
Traceback (most recent call last):
  File "./scripts/train_dna2vec.py", line 12, in <module>
    from attic_util.time_benchmark import Benchmark
ImportError: No module named 'attic_util'

this is executed from ~/dna2vec

The reason for this is intrain_dna2vec.pythe relative path to attic_util and dna2vec are appended to sys.path. Idiosyncratically, python appends the '../' from the folder that the script was called from.

the work around is easy - just call the script from within ./scripts

for cleaner implementation though, it might be better to consider using an egg or some other setup that allows attic_utils and dna2vec to be called from elsewhere

pnpnpn commented 7 years ago

Ah, thank you for noticing this. I had '.' permanently added to my PYTHONPATH. I made a PR that should fix that: https://github.com/pnpnpn/dna2vec/pull/5. You can now call the training code from either the project root or scripts/.

I will try to use egg and put it up on pypi.

stanleyjs commented 7 years ago

Thanks for fixing this - I will let you know if I run into more problems getting training going, and I'll try to contribute to bugfixes as I go.