pythonjupytersnorkel

ModuleNotFoundError: No module named 'snorkel.labeling'


I installed snorkel using conda and when I try to run - from snorkel.labeling import labeling_function it throws the following error - ModuleNotFoundError: No module named 'snorkel.labeling'.

I tried looking up for a solution on Github, but unfortunately, I couldn't follow through. I have also tried installing nb_conda_kernels, to make all your conda environments available in jupyterbut it didn't help. Also tried creating a separate env, installing snorkel and launching jupyter notebook from the snorkel's environment, and it didn't work either. Any form of help is much appreciated!

Thanks in advance!


Solution

  • Try these install instructions:

    conda create --yes -n snorkel
    conda activate snorkel
    conda install pytorch==1.1.0 -c pytorch
    conda install snorkel==0.9.0 -c conda-forge
    

    Or these, listed here:

    # [OPTIONAL] Activate a virtual environment
    conda create --yes -n spam python=3.6
    conda activate spam
    
    # Install requirements (both shared and tutorial-specific)
    pip install environment_kernels
    # We specify PyTorch here to ensure compatibility, but it may not be necessary.
    conda install pytorch==1.1.0 -c pytorch
    conda install snorkel==0.9.5 -c conda-forge
    pip install -r spam/requirements.txt
    
    # Launch the Jupyter notebook interface
    jupyter notebook spam