Python Major Troubleshooting [101-120]
Recommended Post: 【Python】 Python Table of Contents
101. AttributeError: ‘builtin_function_or_method’ object has no attribute ‘default’
⑴ (**package**) Solution: Downgrade torch_geometric version from 2.6.1 to 1.7.2 or 2.0.0 (ref)
102. ImportError: Could not import sentence_transformers python package. Please install it with pip install sentence-transformers
.
⑴ (**package**) Problem Description: embedding_function = SentenceTransformerEmbeddings(model_name="all-MiniLM-L6-v2")
⑵ (**package**) Solution: Downgrade huggingface_hub version to 0.24.6.
103. TypeError: ‘type’ object is not subscriptable
⑴ (package) Solution: Upgrade python version from 3.8 to 3.9.
104. AttributeError: module ‘numpy.lib’ has no attribute ‘pad’
⑴ (package) Solution 1. Downgrade numpy version
⑵ (grammar) Solution 2. Change numpy.lib.pad
to numpy.pad
.
105. ValueError: <COMPRESSION.JPEG: 7> requires the ‘imagecodecs’ package
⑴ (package) Solution: pip install imagecodecs
or conda install -c conda-forge imagecodecs
Input: 2025.01.21 23:29