matplotlib.pyplot import報錯: ValueError: _getfullpathname: embedded null character in path


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

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM