Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import error #1

Open
THinnerichs opened this issue Sep 25, 2019 · 2 comments
Open

Import error #1

THinnerichs opened this issue Sep 25, 2019 · 2 comments

Comments

@THinnerichs
Copy link

THinnerichs commented Sep 25, 2019

The usage of your very cool package seems to raise a lot of errors under current python versions. Due to implicit relative imports being deprecated a lot of your imports cannot find the files in the same directory. To fix this please use explicit relative imports. An example:

Executing the example from your website using Kmer:

from repDNA import util, nac, nacutil

seqs = util.get_data(open("/.../my_sequence.fa"))
kmer = nac.Kmer(k=2)
print(kmer.make_kmer_vec(seqs[0]))

raises:

ModuleNotFoundError: No module named 'nacutil'

Thus, please replace any imports like

from nacutil import make_upto_kmer_list, make_revcomp_kmer_list, make_kmer_vector

with relative imports like this:

from .nacutil import make_upto_kmer_list, make_revcomp_kmer_list, make_kmer_vector

placing a point before every imported python file within the same package.

@QingjingFei
Copy link

The usage of your very cool package seems to raise a lot of errors under current python versions. Due to implicit relative imports being deprecated a lot of your imports cannot find the files in the same directory. To fix this please use explicit relative imports. An example:

Executing the example from your website using Kmer:

from repDNA import util, nac, nacutil

seqs = util.get_data(open("/.../my_sequence.fa"))
kmer = nac.Kmer(k=2)
print(kmer.make_kmer_vec(seqs[0]))

raises:

ModuleNotFoundError: No module named 'nacutil'

Thus, please replace any imports like

from nacutil import make_upto_kmer_list, make_revcomp_kmer_list, make_kmer_vector

with relative imports like this:

from .nacutil import make_upto_kmer_list, make_revcomp_kmer_list, make_kmer_vector

placing a point before every imported python file within the same package.

Thank you! I ran into the problem you mentioned. There's import problems indeed in nearly python version(3.7).

@Wayne42
Copy link

Wayne42 commented May 13, 2021

Thank you. Fixed my issue. Please push this fix soon. Last commit was many, many years ago...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants