ModuleNotFoundError: No module named 'snorkel.labeling'

ModuleNotFoundError: No module named 'snorkel.labeling'

我使用 conda 安装了 snorkel,当我尝试 运行 - from snorkel.labeling import labeling_function 它抛出以下错误 - ModuleNotFoundError: No module named 'snorkel.labeling'.

我尝试在 Github 上寻找解决方案,但不幸的是,我无法跟进。我还尝试安装 nb_conda_kernels,以使您的所有 conda 环境在 jupyter 中可用,但它没有帮助。还尝试创建一个单独的 env,安装 snorkel 并从 snorkel 的环境中启动 jupyter notebook,但它也没有用。非常感谢任何形式的帮助!

提前致谢!

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

请尝试以下操作:

对于 pip 用户

pip install snorkel

conda 用户

conda install snorkel -c conda-forge