0

I installed spleeter using Conda in a conda virtual environment. I am trying to import the Seperator class, but I am getting a ModuleNotFoundError. How do I figure out where the spleeter python files that I am trying to access are at so I can correctly import them? I looked through all the files in my virtual environment, but none of them had any Python files. Also, does my code need to be placed in my virtual environment directory or can it be somewhere else?

Code I am using to try to import and instantiate a Separator object:

import sys
from spleeter.separator import Separator

def get_stems(filePath, fileSavePath):
    separator = Separator('spleeter:2stems')
    separator.separate_to_file(filePath, fileSavePath)
    return None

def main(filePath, savePath):
    print("File path: {}".format(filePath))
    print("File path: {}".format(savePath))
    get_stems(filePath, savePath)
    return savePath

if __name__ == "__main__":
    main('audio_example.mp3', 'audio_example_output.mp3')

Here are the different file structures I have tried:

Conda virtual environment where spleeter was installed with conda install command:

enter image description here

Outside of virtual environment with files downloaded from spleeter GitHub (tried with conda env activated and not activated):

enter image description here

Carter King
  • 59
  • 1
  • 5

0 Answers0