Korean, Edit

Python Key Troubleshooting [81-100]

Recommended Article : 【Python】 Python Index



81. AnnDataReadError: Above error raised while reading key ‘/layers’ of type <class ‘h5py._hl.group.Group’> from /.

⑴ (package) Issue : Issue occurs when running scanpy.read_h5ad

⑵ (package) Solution : Upgrade anndata version from 0.7.8 to 0.9.2 (ref)



82. KeyError: ‘y’

⑴ ( ** grammar** ) Issue : Issue occurs when executing sc.pl.violin(adata, keys=celltype, groupby='annotation')

⑵ ( ** grammar** ) Cause : adata.obs[celltype] contains NaN values



83. Korean fonts not visible on the plot, displaying as ‘ㅁㅁㅁ’

⑴ ( ** grammar** ) Solution

Method 1. Search for available fonts on the system, set a Korean-supported font as default

Method 2. Available fonts can also be found using the following code

Method 3. Download the .ttf font file and set the path of this font file as the default font



84. ModuleNotFoundError: No module named ‘jax.experimental.global_device_array’

⑴ (package) Cause : GlobalDeviceArray was deprecated in JAX version 0.4.1 and removed in JAX version 0.4.7



85. OSError: cannot write mode I;16 as JPEG

⑴ (grammar) Issue : Error occurs when executing Image.open("input_image.tif").save('output_image.jpg', 'JPEG')

⑵ (grammar) Solution : Image.open("input_image.tif").save('output_image.png', 'PNG') works (ref)



86. AttributeError: module ‘PIL.Image’ has no attribute ‘ANTIALIAS’

⑴ (grammar) Issue : img = img.resize((256, 256), Image.ANTIALIAS)

⑵ (grammar) Solution : img = img.resize((256, 256), Image.LANCZOS)



87. FileExistsError: [Errno 17] JVM DLL not found: Define/path/or/set/JAVA_HOME/variable/properly

⑴ (package) Solution


sudo apt update
sudo apt install default-jdk
readlink -f $(which java)
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64 
export PATH=$JAVA_HOME/bin:$PATH



88. ModuleNotFoundError: No module named ‘faiss’

⑴ (package) Solution: pip install faiss-cpu and pip install faiss-gpu



89. ModuleNotFoundError: No module named ‘PIL’

⑴ (package) Solution: pip install Pillow



90. AttributeError: ‘Series’ object has no attribute ‘iteritems’

⑴ (package) Solution: Change the Pandas package version to below 2.0.0. (ref)



91. SyntaxError: Missing parentheses in call to ‘print’. Did you mean print(‘Macros:’)? [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed × Encountered error while generating package metadata. ╰─> See above for output. note: This is an issue with the package mentioned above, not pip.

⑴ (package) Issue: pip install multiprocessing

⑵ (package) Solution: The multiprocessing package is used in Python 2.x, so trying to install the multiprocessing package in Python 3.x will result in an error.



92. IndentationError: unindent does not match any outer indentation level

⑴ (grammar) Solution 1: Use spaces consistently (ref)

⑵ (grammar) Solution 2: Errors often occur in newly added parts of the code. In such cases, copying a part of the existing code with the same indentation level and pasting it into the newly added code can resolve the issue.



93. OpenBLAS warning: precompiled NUM_THREADS exceeded, adding auxiliary array for thread metadata. Segmentation fault (core dumped)

⑴ (system) Solution: Use the command export OPENBLAS_NUM_THREADS=4 to limit the number of OpenBLAS threads system-wide.



94. AttributeError: module ‘pulp’ has no attribute ‘list_solvers’. Did you mean: ‘listSolvers’?

⑴ (package) Solution: pip install pulp==2.7



95. Preparing metadata (setup.py) … error error: subprocess-exited-with-error … error in pysam setup command: use_2to3 is invalid … note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed

⑴ (package) Issue: An error occurs when running pip install lapels.

⑵ (package) Solution: Downgrade the Python environment to version 3.5 or lower.



96. easy_install: command not found

⑴ (package) Solution: easy_install no longer exists, it was replaced by pip install. (ref)



97. ‘str’ object has no attribute ‘decode’

⑴ (grammar) Solution: Simply drop the .decode('utf-8') part (ref)



Written: 2024.06.07 15:03

Revised: 2024.09.06 18:53

results matching ""

    No results matching ""