speech_dtw icon indicating copy to clipboard operation
speech_dtw copied to clipboard

Testing code failed

Open elenazy opened this issue 4 years ago • 7 comments

Hi, I followed builing and testing code : make test and then the scale attached: `ERROR: Failure: ImportError (cannot import name '_dtw' from 'speech_dtw' (/home/cad-1/zhangying/speech_dtw/speech_dtw/init.py))

Traceback (most recent call last): File "/home/cad-1/anaconda3/lib/python3.7/site-packages/nose/failure.py", line 39, in runTest raise self.exc_val.with_traceback(self.tb) File "/home/cad-1/anaconda3/lib/python3.7/site-packages/nose/loader.py", line 417, in loadTestsFromName addr.filename, addr.module) File "/home/cad-1/anaconda3/lib/python3.7/site-packages/nose/importer.py", line 47, in importFromPath return self.importFromDir(dir_path, fqname) File "/home/cad-1/anaconda3/lib/python3.7/site-packages/nose/importer.py", line 94, in importFromDir mod = load_module(part_fqname, fh, filename, desc) File "/home/cad-1/anaconda3/lib/python3.7/imp.py", line 234, in load_module return load_source(name, filename, file) File "/home/cad-1/anaconda3/lib/python3.7/imp.py", line 171, in load_source module = _load(spec) File "", line 696, in _load File "", line 677, in _load_unlocked File "", line 728, in exec_module File "", line 219, in _call_with_frames_removed File "/home/cad-1/zhangying/speech_dtw/speech_dtw/tests/test_dtw.py", line 10, in from speech_dtw import _dtw ImportError: cannot import name '_dtw' from 'speech_dtw' (/home/cad-1/zhangying/speech_dtw/speech_dtw/init.py)

` Please give me some help.Thankss!

elenazy avatar Jun 25 '20 05:06 elenazy

Hey @elenazy,

Did you run the make command before, and did that complete successfully?

Cheers

kamperh avatar Jun 25 '20 08:06 kamperh

Hi, May be I failed in make command .Below is detail: (kws-zy) cad-1@cad1-SYS-7048GR-TR:~/zhangying/speech_dtw$ **make** python setup.py build_ext --inplace running build_ext skipping 'speech_dtw/_dtw.c' Cython extension (up-to-date) Last time I installed Cython=0.26 to match up Python3.6 on Ubuntu,so is it a Cython version problem? I really need your help.

Hey @elenazy,

Did you run the make command before, and did that complete successfully?

Cheers

elenazy avatar Jun 25 '20 08:06 elenazy

Try to quickly run make clean and then run make again, just to make sure it actually compiles. Then check if there is actually a speech_dtw/_dtw.c file afterwards. It might be a Cython issue, and these steps will tell you if that's the problem.

kamperh avatar Jun 25 '20 08:06 kamperh

Hi, I followed your advice and then speech_dtw/_dtw.c file indeed exists. (kws-zy) cad-1@cad1-SYS-7048GR-TR:~/zhangying/speech_dtw/speech_dtw$ ls _dtw.c _dtw.pyx __pycache__ tests _dtw.cpython-36m-x86_64-linux-gnu.so __init__.py qbe.py But after run make test command ,I still face the same error detail: `(kws-zy) cad-1@cad1-SYS-7048GR-TR:~/zhangying/speech_dtw$ make test nosetests -v Failure: ImportError (cannot import name '_dtw' from 'speech_dtw' (/home/cad-1/zhangying/speech_dtw/speech_dtw/init.py)) ... ERROR Failure: ImportError (cannot import name '_dtw' from 'speech_dtw' (/home/cad-1/zhangying/speech_dtw/speech_dtw/init.py)) ... ERROR

====================================================================== ERROR: Failure: ImportError (cannot import name '_dtw' from 'speech_dtw' (/home/cad-1/zhangying/speech_dtw/speech_dtw/init.py))

Traceback (most recent call last): File "/home/cad-1/anaconda3/lib/python3.7/site-packages/nose/failure.py", line 39, in runTest raise self.exc_val.with_traceback(self.tb) File "/home/cad-1/anaconda3/lib/python3.7/site-packages/nose/loader.py", line 417, in loadTestsFromName addr.filename, addr.module) File "/home/cad-1/anaconda3/lib/python3.7/site-packages/nose/importer.py", line 47, in importFromPath return self.importFromDir(dir_path, fqname) File "/home/cad-1/anaconda3/lib/python3.7/site-packages/nose/importer.py", line 94, in importFromDir mod = load_module(part_fqname, fh, filename, desc) File "/home/cad-1/anaconda3/lib/python3.7/imp.py", line 234, in load_module return load_source(name, filename, file) File "/home/cad-1/anaconda3/lib/python3.7/imp.py", line 171, in load_source module = _load(spec) File "", line 696, in _load File "", line 677, in _load_unlocked File "", line 728, in exec_module File "", line 219, in _call_with_frames_removed File "/home/cad-1/zhangying/speech_dtw/speech_dtw/tests/test_dtw.py", line 10, in from speech_dtw import _dtw ImportError: cannot import name '_dtw' from 'speech_dtw' (/home/cad-1/zhangying/speech_dtw/speech_dtw/init.py) ` So it may actually be Cython version fault,can you tell me your program environment configuration ?

Try to quickly run make clean and then run make again, just to make sure it actually compiles. Then check if there is actually a speech_dtw/_dtw.c file afterwards. It might be a Cython issue, and these steps will tell you if that's the problem.

elenazy avatar Jun 25 '20 08:06 elenazy

Were are you running make test from? And I find the reference to speech_dtw/speech_dtw/init.py a bit weird, think that should be speech_dtw/speech_dtw/__init__.py.

kamperh avatar Jun 25 '20 08:06 kamperh

Hi, The path to run make test is same as run make: /home/cad-1/zhangying/speech_dtw which contains MakeFile, utils, examples...folder.

I made a mistake replying to you and find speech_dtw/speech_dtw/__init__.py is right.Maybe copy's error,and I didnt check carefully.

Were are you running make test from? And I find the reference to speech_dtw/speech_dtw/init.py a bit weird, think that should be speech_dtw/speech_dtw/__init__.py.

elenazy avatar Jun 25 '20 09:06 elenazy

Hi, I have the same problem. Is it solved?

jingru-lin avatar Jun 22 '22 05:06 jingru-lin

I've tried a few times now, and cannot replicate this error. I suspect it is a versioning issue. Sorry everyone!

kamperh avatar May 06 '24 09:05 kamperh