ModuleNotFoundError:没有名为“ snorkel.labeling”的模块

时间:2020-08-04 09:04:45

标签: python jupyter snorkel

我使用conda安装了呼吸管,当我尝试运行时-from snorkel.labeling import labeling_function会引发以下错误-ModuleNotFoundError: No module named 'snorkel.labeling'

我试图在Github上寻找解决方案,但不幸的是,我无法跟进。我还尝试安装nb_conda_kernels,以使所有的conda环境都可以在jupyter中使用,但这没有帮助。还尝试创建一个单独的环境,安装通气管并从通气管环境中启动jupyter笔记本,但这也没有用。任何形式的帮助都将不胜感激!

谢谢!

2 个答案:

答案 0 :(得分:0)

尝试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

或者这些,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

答案 1 :(得分:0)

请尝试以下操作:

对于点子用户

pip install snorkel

对于conda用户

conda install snorkel -c conda-forge