{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreih5ik6vvju3zmswcty4apnwrvqjy4da3fnazyuaaagvopsm6qnnee",
    "uri": "at://did:plc:pgryn3ephfd2xgft23qokfzt/app.bsky.feed.post/3mnljtd5skro2"
  },
  "path": "/t/chapter-1-questions/6797?page=6#post_123",
  "publishedAt": "2026-06-06T00:09:18.000Z",
  "site": "https://discuss.huggingface.co",
  "textContent": "When I use the Colab notebook, I get an error on the second cell. Does anyone know how to fix it?\n\nfrom transformers import pipeline\n\nclassifier = pipeline(“sentiment-analysis”)\n\nclassifier(“I’ve been waiting for a HuggingFace course my whole life.”)\n\n---------------------------------------------------------------------------\nAttributeError Traceback (most recent call last)\n/usr/local/lib/python3.12/dist-packages/transformers/utils/import_utils.py in __getattr_ _(self, name)\n2248 try:\n→ 2249 module = self._get_module(self._class_to_module[name])\n2250 value = getattr(module, name)\n\n/usr/local/lib/python3.12/dist-packages/transformers/utils/import_utils.py in _get_module(self, module_name)\n2482 except Exception as e:\n→ 2483 raise e\n2484\n\n/usr/local/lib/python3.12/dist-packages/transformers/utils/import_utils.py in _get_module(self, module_name)\n2480 try:\n→ 2481 return importlib.import_module(“.” + module_name, self.__name_ _)\n2482 except Exception as e:\n\n/usr/lib/python3.12/importlib/__init_ _.py in import_module(name, package)\n89 level += 1\n—> 90 return _bootstrap._gcd_import(name[level:], package, level)\n91\n\n/usr/lib/python3.12/importlib/_bootstrap.py in _gcd_import(name, package, level)\n\n/usr/lib/python3.12/importlib/_bootstrap.py in _find_and_load(name, import_)\n\n/usr/lib/python3.12/importlib/_bootstrap.py in _find_and_load_unlocked(name, import_)\n\n/usr/lib/python3.12/importlib/_bootstrap.py in _load_unlocked(spec)\n\n/usr/lib/python3.12/importlib/_bootstrap_external.py in exec_module(self, module)\n\n/usr/lib/python3.12/importlib/_bootstrap.py in _call_with_frames_removed(f, *args, **kwds)\n\n/usr/local/lib/python3.12/dist-packages/transformers/pipelines/__init_ _.py in\n26 from ..feature_extraction_utils import FeatureExtractionMixin\n—> 27 from ..image_processing_utils import BaseImageProcessor\n28 from ..models.auto.configuration_auto import AutoConfig\n\n/usr/local/lib/python3.12/dist-packages/transformers/image_processing_utils.py in\n33 )\n—> 34 from .processing_utils import ImagesKwargs, Unpack\n35 from .utils import (\n\n/usr/local/lib/python3.12/dist-packages/transformers/processing_utils.py in\n62 from .utils.chat_template_utils import _get_template_variables, render_jinja_template\n—> 63 from .utils.type_validators import (\n64 device_validator,\n\n/usr/local/lib/python3.12/dist-packages/transformers/utils/type_validators.py in\n7 from ..tokenization_utils_base import PaddingStrategy, TruncationStrategy\n----> 8 from ..video_utils import VideoMetadataType\n9 from .generic import TensorType\n\n/usr/local/lib/python3.12/dist-packages/transformers/video_utils.py in\n48 if is_torchvision_available():\n—> 49 from torchvision import io as torchvision_io\n50\n\n/usr/local/lib/python3.12/dist-packages/torchvision/__init_ _.py in\n7 from . import extension # usort:skip # noqa: F401\n----> 8 from torchvision import _meta_registrations, datasets, io, models, ops, transforms, utils # usort:skip\n9\n\n/usr/local/lib/python3.12/dist-packages/torchvision/models/__init_ _.py in\n1 from .alexnet import *\n----> 2 from .convnext import *\n3 from .densenet import *\n\n/usr/local/lib/python3.12/dist-packages/torchvision/models/convnext.py in\n9 from ..ops.misc import Conv2dNormActivation, Permute\n—> 10 from ..ops.stochastic_depth import StochasticDepth\n11 from ..transforms._presets import ImageClassification\n\n/usr/local/lib/python3.12/dist-packages/torchvision/ops/__init_ _.py in\n22 from .misc import Conv2dNormActivation, Conv3dNormActivation, FrozenBatchNorm2d, MLP, Permute, SqueezeExcitation\n—> 23 from .poolers import MultiScaleRoIAlign\n24 from .ps_roi_align import ps_roi_align, PSRoIAlign\n\n/usr/local/lib/python3.12/dist-packages/torchvision/ops/poolers.py in\n9 from ..utils import _log_api_usage_once\n—> 10 from .roi_align import roi_align\n11\n\n/usr/local/lib/python3.12/dist-packages/torchvision/ops/roi_align.py in\n6 from torch import nn, Tensor\n----> 7 from torch._dynamo.utils import is_compile_supported\n8 from torch.jit.annotations import BroadcastingList2\n\n/usr/local/lib/python3.12/dist-packages/torch/_dynamo/__init_ _.py in\n12\n—> 13 from . import (\n14 aot_compile,\n\n/usr/local/lib/python3.12/dist-packages/torch/_dynamo/aot_compile.py in\n14 import torch.fx\n—> 15 from torch._dynamo.convert_frame import GraphRuntimeEnv\n16 from torch._dynamo.graph_utils import _graph_device_type\n\n/usr/local/lib/python3.12/dist-packages/torch/_dynamo/convert_frame.py in\n61 from torch._dynamo.distributed import get_compile_pg\n—> 62 from torch._dynamo.symbolic_convert import TensorifyState\n63 from torch._guards import compile_context, CompileContext, CompileId, tracing\n\n/usr/local/lib/python3.12/dist-packages/torch/_dynamo/symbolic_convert.py in\n53 from torch._dynamo.dynamo_profiler import DynamoProfilerState, FunctionTraceTiming\n—> 54 from torch._dynamo.exc import ObservedException, TensorifyScalarRestartAnalysis\n55 from torch._guards import InlinedCodeCache, tracing, TracingContext\n\n/usr/local/lib/python3.12/dist-packages/torch/_dynamo/exc.py in\n43 from . import config\n—> 44 from .utils import counters\n45\n\n/usr/local/lib/python3.12/dist-packages/torch/_dynamo/utils.py in\n69 import torch._functorch.config\n—> 70 import torch.fx.experimental.symbolic_shapes\n71 import torch.utils._pytree as pytree\n\n/usr/local/lib/python3.12/dist-packages/torch/fx/experimental/symbolic_shapes.py in\n79 from torch.utils._python_dispatch import is_traceable_wrapper_subclass\n—> 80 from torch.utils._sympy.functions import (\n81 Application,\n\n/usr/local/lib/python3.12/dist-packages/torch/utils/_sympy/functions.py in\n187 # not, this can potentially cause correctness issues.\n→ 188 class FloorDiv(sympy.Function):\n189 “”\"\n\n/usr/local/lib/python3.12/dist-packages/torch/utils/_sympy/functions.py in FloorDiv()\n210\n→ 211 def _sympystr(self, printer: sympy.printing.StrPrinter) → str:\n212 base = printer.parenthesize(self.base, PRECEDENCE[“Atom”] - 0.5)\n\nAttributeError: module ‘sympy’ has no attribute ‘printing’\n\nThe above exception was the direct cause of the following exception:\n\nModuleNotFoundError Traceback (most recent call last)\n\n/tmp/ipykernel_3167/711506748.py in <cell line: 0>()\n----> 1 from transformers import pipeline\n2\n3 classifier = pipeline(“sentiment-analysis”)\n4 classifier(“I’ve been waiting for a HuggingFace course my whole life.”)\n\n/usr/local/lib/python3.12/dist-packages/transformers/utils/import_utils.py in __getattr_ _(self, name)\n2335 ) from e\n2336 else:\n→ 2337 raise ModuleNotFoundError(\n2338 f\"Could not import module ‘{name}’. Are this object’s requirements defined correctly?\"\n2339 ) from e\n\nModuleNotFoundError: Could not import module ‘pipeline’. Are this object’s requirements defined correctly?",
  "title": "Chapter 1 questions"
}