Python-matplotlib Import Pyplot An error occurred in the resolution.

Source: Internet
Author: User

Workaround for _getfullpathname:emedded null character appears: (Go from http://stackoverflow.com)

This was a bug in Python and not matplotlib.

winreg.EnumValueThe issue is-is isn't cutting string values at their length properly for some reason, and strings would include Nu ll characters which is isn't os.path.abspath able to process.

The registry entry where this happens are at SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts . Despite this isn't being matplotlib ' s fault we can still temporarily patch it so it ends the string at ‘\0‘ . font_manager.pyin, Patch line 310 in the win32InstalledFonts() function to:

key, direc, any = winreg.EnumValue( local, j)if not is_string_like(direc):    continueif not os.path.dirname(direc):    direc = os.path.join(directory, direc)direc = direc.split(‘\0‘, 1)[0]

Python-matplotlib Import Pyplot An error occurred in the resolution.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.