dejavu icon indicating copy to clipboard operation
dejavu copied to clipboard

WindowsError [Error 2] when running example

Open 2efPer opened this issue 7 years ago • 1 comments

Failed fingerprinting Traceback (most recent call last): File "E:\dejavu\dejavu\__init__.py", line 77, in fingerprint_directory song_name, hashes, file_hash = iterator.next() File "C:\Python27\lib\multiprocessing\pool.py", line 668, in next raise value WindowsError: [Error 2] Failed fingerprinting Traceback (most recent call last): File "E:\dejavu\dejavu\__init__.py", line 77, in fingerprint_directory song_name, hashes, file_hash = iterator.next() File "C:\Python27\lib\multiprocessing\pool.py", line 668, in next raise value WindowsError: [Error 2] Failed fingerprinting Traceback (most recent call last): File "E:\dejavu\dejavu\__init__.py", line 77, in fingerprint_directory song_name, hashes, file_hash = iterator.next() File "C:\Python27\lib\multiprocessing\pool.py", line 668, in next raise value WindowsError: [Error 2] Failed fingerprinting Traceback (most recent call last): File "E:\dejavu\dejavu\__init__.py", line 77, in fingerprint_directory song_name, hashes, file_hash = iterator.next() File "C:\Python27\lib\multiprocessing\pool.py", line 668, in next raise value WindowsError: [Error 2] Failed fingerprinting Traceback (most recent call last): File "E:\dejavu\dejavu\__init__.py", line 77, in fingerprint_directory song_name, hashes, file_hash = iterator.next() File "C:\Python27\lib\multiprocessing\pool.py", line 668, in next raise value WindowsError: [Error 2] Traceback (most recent call last): File "E:/dejavu/example.py", line 21, in <module> song = djv.recognize(FileRecognizer, "mp3/Sean-Fournier--Falling-For-You.mp3") File "E:\dejavu\dejavu\__init__.py", line 167, in recognize return r.recognize(*options, **kwoptions) File "E:\dejavu\dejavu\recognize.py", line 41, in recognize return self.recognize_file(filename) File "E:\dejavu\dejavu\recognize.py", line 29, in recognize_file frames, self.Fs, file_hash = decoder.read(filename, self.dejavu.limit) File "E:\dejavu\dejavu\decoder.py", line 51, in read audiofile = AudioSegment.from_file(filename) File "C:\Python27\lib\site-packages\pydub\audio_segment.py", line 505, in from_file p = subprocess.Popen(conversion_command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) File "C:\Python27\lib\subprocess.py", line 390, in __init__ errread, errwrite) File "C:\Python27\lib\subprocess.py", line 640, in _execute_child startupinfo) WindowsError: [Error 2]

Specs: Window7 python2.7 Mysql5.7

thx.

2efPer avatar Oct 20 '17 05:10 2efPer

there is a problem with subprocess while using in python2.7, if you can upgrade to python3+ please do, else use this function where subprocess is used in the error.

def run(*popenargs, input=None, check=False, **kwargs):
    if input is not None:
        if 'stdin' in kwargs:
            raise ValueError('stdin and input arguments may not both be used.')
        kwargs['stdin'] = subprocess.PIPE

    process = subprocess.Popen(*popenargs, **kwargs):
    try:
        stdout, stderr = process.communicate(input)
    except:
        process.kill()
        process.wait()
        raise
    retcode = process.poll()
    if check and retcode:
        raise subprocess.CalledProcessError(
            retcode, process.args, output=stdout, stderr=stderr)
    return retcode, stdout, stderr

anuragkumarak95 avatar Oct 20 '17 05:10 anuragkumarak95