Error information
Read the error information,
return freetype (font),
return freetype font (font, size, index, encoding, layout)_ Oserror: cannot open resource
generally, an error is reported. The reason is that there is a problem in using the resource file
failure reason:
1. First of all, check whether the path you bind is correct. Some people directly bind to the font file in the path of C: (Windows) fonts. This is OK, but you need to use it in Python/
2. If you bind to the font file in the path of C: (Windows) fonts, you can’t use it. Reason: the name of the font may be too long. At this time, we can rename it, Then re install to the path, or directly put your own bound path
3. The bound path is correct, but still an error is reported. Trust the font library to C:// Windows/fonts to see if it is installed. If it is not installed, it may not work
File "./ClothStore/captcha/captcha.py", line 123, in <listcomp>
for size in font_sizes or (65, 70, 75)])
File "/home/ClothStore/venv/lib/python3.7/site-packages/PIL/ImageFont.py", line 655, in truetype
return freetype(font)
File "/home/ClothStore/venv/lib/python3.7/site-packages/PIL/ImageFont.py", line 652, in freetype
return FreeTypeFont(font, size, index, encoding, layout_engine)
File "/home/ClothStore/venv/lib/python3.7/site-packages/PIL/ImageFont.py", line 194, in __init__
font, size, index, encoding, layout_engine=layout_engine
OSError: cannot open resource
Read More:
- “Could not import PIL.Image . The use of array_ to_ The solution of img requires PIL. “
- How to solve oserror: [errno 98] address already in use and kill the python3 process
- Python reports oserror: initializing from file failed
- Mac python install PIL
- Use yum to prompt Error: rpmdb open failed
- Oserror: dlopen() failed to load a library: Cairo / cairo-2 / cairo-gobject-2/ cairo.so .2
- Debugging failed under vscode Ubuntu, unable to open libc-start. C raise. C, etc
- FTP use get command 550 failed to open file, but use the put command to solve the problem
- Python oserror: [errno 22] invalid argument: solution
- Connect to the repository by using the database resource library!
- How to generate lib library with keil MDK and use lib Library
- OpenProj can’t open or prompt “Failed to load Java VM Library” error solution
- Raspberry Pi USB drive-free camera error libv4l2: error setting pixformat: Device or resource busy, etc.
- Solve the oserror: [errno 22] invalid argument: ‘u202ad’ in Python
- Click the button to use in the react project window.open Methods open a new page and click the data again
- Vs2015 cannot open the file string. H, etc
- Python-OSError: [Errno 22]
- On the problem of from PIL import image
- OSError: libnccl.so.2: cannot open shared object file: No such file or directory
- Error reported in Python reading file oserror: [errno 22] invalid argument: ‘u202ac: \ \ users \ \ yyqhk \ \ desktop \ \ 1. CSV’