I found a lot of methods to solve the Chinese garbled code of Matplotlib in Anaconda on the Internet. I feel it is not concise enough. Now let’s make a summary. Two steps, one is to find the font, the other is to set it.
The system font file is usually saved in the C:\Windows\Fonts
Open copy any font:
Save it in the TTF folder. Lu Jin’s name is e::’anaconda ‘,’lib’,’site-packages’,’matplotlib ‘,’mpl-data’,’fonts’,’ttf ‘
You can change the file name of Anaconda installed on your computer, and the following path is the same.
So the font is chosen.
Go back to MPL data and open the matplotlibrc file: e:// Anaconda/lib/site packages/Matplotlib/MPL data
Notepad shows about 249 lines, the upper middle part of the file:
Remove the comment in front of font. Family, and then change the following name to the newly copied font name: simhei.
Save with Ctrl + s and reopen the compiler.
- In Python, import XXX does not report an error, but in IPython (Jupiter notebook)
- cannot import name ‘_validate_lengths’ from ‘numpy.lib.arraypad’
- ModuleNotFoundError: No module named ‘numpy.testing.nosetester‘
- Python failed to use PIL writer library. TTF, etc. oserror: cannot open resource
- Importing the multiarray numpy extension module failed
- sys.path.append(), os.path.exists(), os.path.join() and os.makedirs() meaning
- pip install – PermissionError: [Errno 13] Permission denied
- [error reported] [Python] [Matplotlib] importerror: failed to import any QT binding
- Invalid archiveerror reported by CONDA
- Error in pyinstall package Python program: jinja2.exceptions.templatenotfound: Chart_ Solution to component.html
- Python failed to read TIF file exported by envi.
- Importerror using tensorflow: DLL load failed: the specified program cannot be found
- Finally solved the importError: DLLload failed: the specified module could not be found when import matplotlib.pyplot
- (20200915 solved) vscope appears unable to open ‘hashable’_ class_ helper.pxi ‘
- How to batch create folders in Excel form and copy the specified files to a new folder
- Pychar configures Anaconda environment
- RuntimeError: NCCL error in: /pytorch/torch/lib/c10d/ProcessGroupNCCL.cpp:784 torch
- PIP report failed to create process
- Data analysis to obtain Yahoo stock data: some problems are encountered when using panda datareader (cannot import name ‘is_ list_ Like ‘problem)
- Ctypes loading DLL error oserror: [winerror 126] the specified module could not be found