码迷,mamicode.com
首页 > 其他好文 > 详细

matplotlib.pyplot import报错: ValueError: _getfullpathname: embedded null character in path

时间:2017-02-04 18:24:21      阅读:1080      评论:0      收藏:0      [点我收藏+]

标签:overflow   pac   nbsp   val   cond   ges   query   atp   style   

Environment:

Windows 10,

Anaconda 3.6

matplotlib 2.0

 

import matplotlib.pyplot

报错:

ValueError: _getfullpathname: embedded null character in path

 

原因以及Solution:

http://stackoverflow.com/questions/34004063/error-on-import-matplotlib-pyplot-on-anaconda3-for-windows-10-home-64-bit-pc

 

修改的文件:

Anaconda3/lib/site-packages/matplotlib/font_manager.py

修改的函数:

 def win32InstalledFonts(directory=None, fontext=‘ttf‘):

        try:
            for j in range(winreg.QueryInfoKey(local)[1]):
                try:
                    key, direc, any = winreg.EnumValue( local, j)
                    if not is_string_like(direc):
                        continue
                    if not os.path.dirname(direc):
                        direc = os.path.join(directory, direc)
                    # direc = os.path.abspath(direc).lower()
                    direc = direc.split(\0, 1)[0]
                    if os.path.splitext(direc)[1][1:] in fontext:
                        items[direc] = 1

 

matplotlib.pyplot import报错: ValueError: _getfullpathname: embedded null character in path

标签:overflow   pac   nbsp   val   cond   ges   query   atp   style   

原文地址:http://www.cnblogs.com/norsd/p/6365904.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!