Error "Freetype library not found" during adding points

I tried to add points to the existing viewer using the below simple code:

points = np.array([[100, 100], [200, 200], [300, 100]])
viewer.add_points(points, size=30)

and I got this error:

--------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
~\Anaconda3\lib\site-packages\freetype\raw.py in <module>
     48 try:
---> 49     _lib = ctypes.CDLL(filename)
     50 except (OSError, TypeError):

~\Anaconda3\lib\ctypes\__init__.py in __init__(self, name, mode, handle, use_errno, use_last_error)
    363         if handle is None:
--> 364             self._handle = _dlopen(self._name, mode)
    365         else:

OSError: [WinError 126] The specified module could not be found

During handling of the above exception, another exception occurred:

RuntimeError                              Traceback (most recent call last)
~\Anaconda3\lib\site-packages\vispy\app\backends\_qt.py in paintGL(self)
    823         # (0, 0, self.width(), self.height()))
    824         self._vispy_canvas.set_current()
--> 825         self._vispy_canvas.events.draw(region=None)
    826 
    827 

~\Anaconda3\lib\site-packages\vispy\util\event.py in __call__(self, *args, **kwargs)
    453                     continue
    454 
--> 455                 self._invoke_callback(cb, event)
    456                 if event.blocked:
    457                     break

~\Anaconda3\lib\site-packages\vispy\util\event.py in _invoke_callback(self, cb, event)
    473             _handle_exception(self.ignore_callback_errors,
    474                               self.print_callback_errors,
--> 475                               self, cb_event=(cb, event))
    476 
    477     def _prepare_event(self, *args, **kwargs):

~\Anaconda3\lib\site-packages\vispy\util\event.py in _invoke_callback(self, cb, event)
    469     def _invoke_callback(self, cb, event):
    470         try:
--> 471             cb(event)
    472         except Exception:
    473             _handle_exception(self.ignore_callback_errors,

~\Anaconda3\lib\site-packages\vispy\scene\canvas.py in on_draw(self, event)
    215         # scheduling of further updates
    216         self._update_pending = False
--> 217         self._draw_scene()
    218 
    219     def render(self, region=None, size=None, bgcolor=None, crop=None):

~\Anaconda3\lib\site-packages\vispy\scene\canvas.py in _draw_scene(self, bgcolor)
    264             bgcolor = self._bgcolor
    265         self.context.clear(color=bgcolor, depth=True)
--> 266         self.draw_visual(self.scene)
    267 
    268     def draw_visual(self, visual, event=None):

~\Anaconda3\lib\site-packages\vispy\scene\canvas.py in draw_visual(self, visual, event)
    302                         else:
    303                             if hasattr(node, 'draw'):
--> 304                                 node.draw()
    305                                 prof.mark(str(node))
    306                 else:

~\Anaconda3\lib\site-packages\vispy\scene\visuals.py in draw(self)
     97         if self.picking and not self.interactive:
     98             return
---> 99         self._visual_superclass.draw(self)
    100 
    101 

~\Anaconda3\lib\site-packages\vispy\visuals\visual.py in draw(self)
    593         for v in self._subvisuals:
    594             if v.visible:
--> 595                 v.draw()
    596 
    597     def _prepare_draw(self, view):

~\Anaconda3\lib\site-packages\vispy\scene\visuals.py in draw(self)
     97         if self.picking and not self.interactive:
     98             return
---> 99         self._visual_superclass.draw(self)
    100 
    101 

~\Anaconda3\lib\site-packages\vispy\visuals\visual.py in draw(self)
    433             return
    434         self._configure_gl_state()
--> 435         if self._prepare_draw(view=self) is False:
    436             return
    437 

~\Anaconda3\lib\site-packages\vispy\visuals\text\text.py in _prepare_draw(self, view)
    527             self._vertices = np.concatenate([
    528                 _text_to_vbo(t, self._font, self._anchors[0], self._anchors[1],
--> 529                              self._font._lowres_size) for t in text])
    530             self._vertices = VertexBuffer(self._vertices)
    531             idx = (np.array([0, 1, 2, 0, 2, 3], np.uint32) +

~\Anaconda3\lib\site-packages\vispy\visuals\text\text.py in <listcomp>(.0)
    527             self._vertices = np.concatenate([
    528                 _text_to_vbo(t, self._font, self._anchors[0], self._anchors[1],
--> 529                              self._font._lowres_size) for t in text])
    530             self._vertices = VertexBuffer(self._vertices)
    531             idx = (np.array([0, 1, 2, 0, 2, 3], np.uint32) +

~\Anaconda3\lib\site-packages\vispy\visuals\text\text.py in _text_to_vbo(text, font, anchor_x, anchor_y, lowres_size)
    176     # vertical alignment can be very inconsistent
    177     for char in 'hy':
--> 178         glyph = font[char]
    179         y0 = glyph['offset'][1] * ratio + slop
    180         y1 = y0 - glyph['size'][1]

~\Anaconda3\lib\site-packages\vispy\visuals\text\text.py in __getitem__(self, char)
     79             raise TypeError('index must be a 1-character string')
     80         if char not in self._glyphs:
---> 81             self._load_char(char)
     82         return self._glyphs[char]
     83 

~\Anaconda3\lib\site-packages\vispy\visuals\text\text.py in _load_char(self, char)
     93         assert char not in self._glyphs
     94         # load new glyph data from font
---> 95         _load_glyph(self._font, char, self._glyphs)
     96         # put new glyph into the texture
     97         glyph = self._glyphs[char]

~\Anaconda3\lib\site-packages\vispy\util\fonts\_freetype.py in _load_glyph(f, char, glyphs_dict)
     45 def _load_glyph(f, char, glyphs_dict):
     46     """Load glyph from font into dict"""
---> 47     from freetype import (FT_LOAD_RENDER, FT_LOAD_NO_HINTING,
     48                           FT_LOAD_NO_AUTOHINT)
     49     flags = FT_LOAD_RENDER | FT_LOAD_NO_HINTING | FT_LOAD_NO_AUTOHINT

~\Anaconda3\lib\site-packages\freetype\__init__.py in <module>
     22 import struct
     23 
---> 24 from freetype.raw import *
     25 
     26 # Hack to get unicode class in python3

~\Anaconda3\lib\site-packages\freetype\raw.py in <module>
     50 except (OSError, TypeError):
     51     _lib = None
---> 52     raise RuntimeError('Freetype library not found')
     53 
     54 FT_Init_FreeType       = _lib.FT_Init_FreeType

RuntimeError: Freetype library not found

---------------------------------------------------------------------------

~\Anaconda3\lib\site-packages\vispy\visuals\text\text.py in __getitem__(self, char)
     79             raise TypeError('index must be a 1-character string')
     80         if char not in self._glyphs:
---> 81             self._load_char(char)
     82         return self._glyphs[char]
     83 

~\Anaconda3\lib\site-packages\vispy\visuals\text\text.py in _load_char(self, char)
     93         assert char not in self._glyphs
     94         # load new glyph data from font
---> 95         _load_glyph(self._font, char, self._glyphs)
     96         # put new glyph into the texture
     97         glyph = self._glyphs[char]

~\Anaconda3\lib\site-packages\vispy\util\fonts\_freetype.py in _load_glyph(f, char, glyphs_dict)
     45 def _load_glyph(f, char, glyphs_dict):
     46     """Load glyph from font into dict"""
---> 47     from freetype import (FT_LOAD_RENDER, FT_LOAD_NO_HINTING,
     48                           FT_LOAD_NO_AUTOHINT)
     49     flags = FT_LOAD_RENDER | FT_LOAD_NO_HINTING | FT_LOAD_NO_AUTOHINT

~\Anaconda3\lib\site-packages\freetype\__init__.py in <module>
     22 import struct
     23 
---> 24 from freetype.raw import *
     25 
     26 # Hack to get unicode class in python3

~\Anaconda3\lib\site-packages\freetype\raw.py in <module>
     50 except (OSError, TypeError):
     51     _lib = None
---> 52     raise RuntimeError('Freetype library not found')
     53 
     54 FT_Init_FreeType       = _lib.FT_Init_FreeType

RuntimeError: Freetype library not found


~\Anaconda3\lib\site-packages\vispy\visuals\text\text.py in _load_char(self, char)
     93         assert char not in self._glyphs
     94         # load new glyph data from font
---> 95         _load_glyph(self._font, char, self._glyphs)
     96         # put new glyph into the texture
     97         glyph = self._glyphs[char]

~\Anaconda3\lib\site-packages\vispy\util\fonts\_freetype.py in _load_glyph(f, char, glyphs_dict)
     45 def _load_glyph(f, char, glyphs_dict):
     46     """Load glyph from font into dict"""
---> 47     from freetype import (FT_LOAD_RENDER, FT_LOAD_NO_HINTING,
     48                           FT_LOAD_NO_AUTOHINT)
     49     flags = FT_LOAD_RENDER | FT_LOAD_NO_HINTING | FT_LOAD_NO_AUTOHINT

~\Anaconda3\lib\site-packages\freetype\__init__.py in <module>
     22 import struct
     23 
---> 24 from freetype.raw import *
     25 
     26 # Hack to get unicode class in python3

~\Anaconda3\lib\site-packages\freetype\raw.py in <module>
     50 except (OSError, TypeError):
     51     _lib = None
---> 52     raise RuntimeError('Freetype library not found')
     53 
     54 FT_Init_FreeType       = _lib.FT_Init_FreeType

RuntimeError: Freetype library not found

---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
~\Anaconda3\lib\site-packages\freetype\raw.py in <module>
     48 try:
---> 49     _lib = ctypes.CDLL(filename)
     50 except (OSError, TypeError):

~\Anaconda3\lib\ctypes\__init__.py in __init__(self, name, mode, handle, use_errno, use_last_error)
    363         if handle is None:
--> 364             self._handle = _dlopen(self._name, mode)
    365         else:

OSError: [WinError 126] The specified module could not be found

During handling of the above exception, another exception occurred:

RuntimeError                              Traceback (most recent call last)
~\Anaconda3\lib\site-packages\vispy\app\backends\_qt.py in paintGL(self)
    823         # (0, 0, self.width(), self.height()))
    824         self._vispy_canvas.set_current()
--> 825         self._vispy_canvas.events.draw(region=None)
    826 
    827 

~\Anaconda3\lib\site-packages\vispy\util\event.py in __call__(self, *args, **kwargs)
    453                     continue
    454 
--> 455                 self._invoke_callback(cb, event)
    456                 if event.blocked:
    457                     break

~\Anaconda3\lib\site-packages\vispy\util\event.py in _invoke_callback(self, cb, event)
    473             _handle_exception(self.ignore_callback_errors,
    474                               self.print_callback_errors,
--> 475                               self, cb_event=(cb, event))
    476 
    477     def _prepare_event(self, *args, **kwargs):

~\Anaconda3\lib\site-packages\vispy\util\event.py in _invoke_callback(self, cb, event)
    469     def _invoke_callback(self, cb, event):
    470         try:
--> 471             cb(event)
    472         except Exception:
    473             _handle_exception(self.ignore_callback_errors,

~\Anaconda3\lib\site-packages\vispy\scene\canvas.py in on_draw(self, event)
    215         # scheduling of further updates
    216         self._update_pending = False
--> 217         self._draw_scene()
    218 
    219     def render(self, region=None, size=None, bgcolor=None, crop=None):

~\Anaconda3\lib\site-packages\vispy\scene\canvas.py in _draw_scene(self, bgcolor)
    264             bgcolor = self._bgcolor
    265         self.context.clear(color=bgcolor, depth=True)
--> 266         self.draw_visual(self.scene)
    267 
    268     def draw_visual(self, visual, event=None):

~\Anaconda3\lib\site-packages\vispy\scene\canvas.py in draw_visual(self, visual, event)
    302                         else:
    303                             if hasattr(node, 'draw'):
--> 304                                 node.draw()
    305                                 prof.mark(str(node))
    306                 else:

~\Anaconda3\lib\site-packages\vispy\scene\visuals.py in draw(self)
     97         if self.picking and not self.interactive:
     98             return
---> 99         self._visual_superclass.draw(self)
    100 
    101 

~\Anaconda3\lib\site-packages\vispy\visuals\visual.py in draw(self)
    593         for v in self._subvisuals:
    594             if v.visible:
--> 595                 v.draw()
    596 
    597     def _prepare_draw(self, view):

~\Anaconda3\lib\site-packages\vispy\scene\visuals.py in draw(self)
     97         if self.picking and not self.interactive:
     98             return
---> 99         self._visual_superclass.draw(self)
    100 
    101 

~\Anaconda3\lib\site-packages\vispy\visuals\visual.py in draw(self)
    433             return
    434         self._configure_gl_state()
--> 435         if self._prepare_draw(view=self) is False:
    436             return
    437 

~\Anaconda3\lib\site-packages\vispy\visuals\text\text.py in _prepare_draw(self, view)
    527             self._vertices = np.concatenate([
    528                 _text_to_vbo(t, self._font, self._anchors[0], self._anchors[1],
--> 529                              self._font._lowres_size) for t in text])
    530             self._vertices = VertexBuffer(self._vertices)
    531             idx = (np.array([0, 1, 2, 0, 2, 3], np.uint32) +

~\Anaconda3\lib\site-packages\vispy\visuals\text\text.py in <listcomp>(.0)
    527             self._vertices = np.concatenate([
    528                 _text_to_vbo(t, self._font, self._anchors[0], self._anchors[1],
--> 529                              self._font._lowres_size) for t in text])
    530             self._vertices = VertexBuffer(self._vertices)
    531             idx = (np.array([0, 1, 2, 0, 2, 3], np.uint32) +

~\Anaconda3\lib\site-packages\vispy\visuals\text\text.py in _text_to_vbo(text, font, anchor_x, anchor_y, lowres_size)
    176     # vertical alignment can be very inconsistent
    177     for char in 'hy':
--> 178         glyph = font[char]
    179         y0 = glyph['offset'][1] * ratio + slop
    180         y1 = y0 - glyph['size'][1]

~\Anaconda3\lib\site-packages\vispy\visuals\text\text.py in __getitem__(self, char)
     79             raise TypeError('index must be a 1-character string')
     80         if char not in self._glyphs:
---> 81             self._load_char(char)
     82         return self._glyphs[char]
     83 

~\Anaconda3\lib\site-packages\vispy\visuals\text\text.py in _load_char(self, char)
     93         assert char not in self._glyphs
     94         # load new glyph data from font
---> 95         _load_glyph(self._font, char, self._glyphs)
     96         # put new glyph into the texture
     97         glyph = self._glyphs[char]

~\Anaconda3\lib\site-packages\vispy\util\fonts\_freetype.py in _load_glyph(f, char, glyphs_dict)
     45 def _load_glyph(f, char, glyphs_dict):
     46     """Load glyph from font into dict"""
---> 47     from freetype import (FT_LOAD_RENDER, FT_LOAD_NO_HINTING,
     48                           FT_LOAD_NO_AUTOHINT)
     49     flags = FT_LOAD_RENDER | FT_LOAD_NO_HINTING | FT_LOAD_NO_AUTOHINT

~\Anaconda3\lib\site-packages\freetype\__init__.py in <module>
     22 import struct
     23 
---> 24 from freetype.raw import *
     25 
     26 # Hack to get unicode class in python3

~\Anaconda3\lib\site-packages\freetype\raw.py in <module>
     50 except (OSError, TypeError):
     51     _lib = None
---> 52     raise RuntimeError('Freetype library not found')
     53 
     54 FT_Init_FreeType       = _lib.FT_Init_FreeType

RuntimeError: Freetype library not found

---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
~\Anaconda3\lib\site-packages\freetype\raw.py in <module>
     48 try:
---> 49     _lib = ctypes.CDLL(filename)
     50 except (OSError, TypeError):

~\Anaconda3\lib\ctypes\__init__.py in __init__(self, name, mode, handle, use_errno, use_last_error)
    363         if handle is None:
--> 364             self._handle = _dlopen(self._name, mode)
    365         else:

OSError: [WinError 126] The specified module could not be found

During handling of the above exception, another exception occurred:

RuntimeError                              Traceback (most recent call last)
~\Anaconda3\lib\site-packages\vispy\app\backends\_qt.py in paintGL(self)
    823         # (0, 0, self.width(), self.height()))
    824         self._vispy_canvas.set_current()
--> 825         self._vispy_canvas.events.draw(region=None)
    826 
    827 

~\Anaconda3\lib\site-packages\vispy\util\event.py in __call__(self, *args, **kwargs)
    453                     continue
    454 
--> 455                 self._invoke_callback(cb, event)
    456                 if event.blocked:
    457                     break

~\Anaconda3\lib\site-packages\vispy\util\event.py in _invoke_callback(self, cb, event)
    473             _handle_exception(self.ignore_callback_errors,
    474                               self.print_callback_errors,
--> 475                               self, cb_event=(cb, event))
    476 
    477     def _prepare_event(self, *args, **kwargs):

~\Anaconda3\lib\site-packages\vispy\util\event.py in _invoke_callback(self, cb, event)
    469     def _invoke_callback(self, cb, event):
    470         try:
--> 471             cb(event)
    472         except Exception:
    473             _handle_exception(self.ignore_callback_errors,

~\Anaconda3\lib\site-packages\vispy\scene\canvas.py in on_draw(self, event)
    215         # scheduling of further updates
    216         self._update_pending = False
--> 217         self._draw_scene()
    218 
    219     def render(self, region=None, size=None, bgcolor=None, crop=None):

~\Anaconda3\lib\site-packages\vispy\scene\canvas.py in _draw_scene(self, bgcolor)
    264             bgcolor = self._bgcolor
    265         self.context.clear(color=bgcolor, depth=True)
--> 266         self.draw_visual(self.scene)
    267 
    268     def draw_visual(self, visual, event=None):

~\Anaconda3\lib\site-packages\vispy\scene\canvas.py in draw_visual(self, visual, event)
    302                         else:
    303                             if hasattr(node, 'draw'):
--> 304                                 node.draw()
    305                                 prof.mark(str(node))
    306                 else:

~\Anaconda3\lib\site-packages\vispy\scene\visuals.py in draw(self)
     97         if self.picking and not self.interactive:
     98             return
---> 99         self._visual_superclass.draw(self)
    100 
    101 

~\Anaconda3\lib\site-packages\vispy\visuals\visual.py in draw(self)
    593         for v in self._subvisuals:
    594             if v.visible:
--> 595                 v.draw()
    596 
    597     def _prepare_draw(self, view):

~\Anaconda3\lib\site-packages\vispy\scene\visuals.py in draw(self)
     97         if self.picking and not self.interactive:
     98             return
---> 99         self._visual_superclass.draw(self)
    100 
    101 

~\Anaconda3\lib\site-packages\vispy\visuals\visual.py in draw(self)
    433             return
    434         self._configure_gl_state()
--> 435         if self._prepare_draw(view=self) is False:
    436             return
    437 

~\Anaconda3\lib\site-packages\vispy\visuals\text\text.py in _prepare_draw(self, view)
    527             self._vertices = np.concatenate([
    528                 _text_to_vbo(t, self._font, self._anchors[0], self._anchors[1],
--> 529                              self._font._lowres_size) for t in text])
    530             self._vertices = VertexBuffer(self._vertices)
    531             idx = (np.array([0, 1, 2, 0, 2, 3], np.uint32) +

~\Anaconda3\lib\site-packages\vispy\visuals\text\text.py in <listcomp>(.0)
    527             self._vertices = np.concatenate([
    528                 _text_to_vbo(t, self._font, self._anchors[0], self._anchors[1],
--> 529                              self._font._lowres_size) for t in text])
    530             self._vertices = VertexBuffer(self._vertices)
    531             idx = (np.array([0, 1, 2, 0, 2, 3], np.uint32) +

~\Anaconda3\lib\site-packages\vispy\visuals\text\text.py in _text_to_vbo(text, font, anchor_x, anchor_y, lowres_size)
    176     # vertical alignment can be very inconsistent
    177     for char in 'hy':
--> 178         glyph = font[char]
    179         y0 = glyph['offset'][1] * ratio + slop
    180         y1 = y0 - glyph['size'][1]

~\Anaconda3\lib\site-packages\vispy\visuals\text\text.py in __getitem__(self, char)
     79             raise TypeError('index must be a 1-character string')
     80         if char not in self._glyphs:
---> 81             self._load_char(char)
     82         return self._glyphs[char]
     83 

~\Anaconda3\lib\site-packages\vispy\visuals\text\text.py in _load_char(self, char)
     93         assert char not in self._glyphs
     94         # load new glyph data from font
---> 95         _load_glyph(self._font, char, self._glyphs)
     96         # put new glyph into the texture
     97         glyph = self._glyphs[char]

~\Anaconda3\lib\site-packages\vispy\util\fonts\_freetype.py in _load_glyph(f, char, glyphs_dict)
     45 def _load_glyph(f, char, glyphs_dict):
     46     """Load glyph from font into dict"""
---> 47     from freetype import (FT_LOAD_RENDER, FT_LOAD_NO_HINTING,
     48                           FT_LOAD_NO_AUTOHINT)
     49     flags = FT_LOAD_RENDER | FT_LOAD_NO_HINTING | FT_LOAD_NO_AUTOHINT

~\Anaconda3\lib\site-packages\freetype\__init__.py in <module>
     22 import struct
     23 
---> 24 from freetype.raw import *
     25 
     26 # Hack to get unicode class in python3

~\Anaconda3\lib\site-packages\freetype\raw.py in <module>
     50 except (OSError, TypeError):
     51     _lib = None
---> 52     raise RuntimeError('Freetype library not found')
     53 
     54 FT_Init_FreeType       = _lib.FT_Init_FreeType

RuntimeError: Freetype library not found

---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
~\Anaconda3\lib\site-packages\freetype\raw.py in <module>
     48 try:
---> 49     _lib = ctypes.CDLL(filename)
     50 except (OSError, TypeError):

~\Anaconda3\lib\ctypes\__init__.py in __init__(self, name, mode, handle, use_errno, use_last_error)
    363         if handle is None:
--> 364             self._handle = _dlopen(self._name, mode)
    365         else:

OSError: [WinError 126] The specified module could not be found

During handling of the above exception, another exception occurred:

RuntimeError                              Traceback (most recent call last)
~\Anaconda3\lib\site-packages\vispy\app\backends\_qt.py in paintGL(self)
    823         # (0, 0, self.width(), self.height()))
    824         self._vispy_canvas.set_current()
--> 825         self._vispy_canvas.events.draw(region=None)
    826 
    827 

~\Anaconda3\lib\site-packages\vispy\util\event.py in __call__(self, *args, **kwargs)
    453                     continue
    454 
--> 455                 self._invoke_callback(cb, event)
    456                 if event.blocked:
    457                     break

~\Anaconda3\lib\site-packages\vispy\util\event.py in _invoke_callback(self, cb, event)
    473             _handle_exception(self.ignore_callback_errors,
    474                               self.print_callback_errors,
--> 475                               self, cb_event=(cb, event))
    476 
    477     def _prepare_event(self, *args, **kwargs):

~\Anaconda3\lib\site-packages\vispy\util\event.py in _invoke_callback(self, cb, event)
    469     def _invoke_callback(self, cb, event):
    470         try:
--> 471             cb(event)
    472         except Exception:
    473             _handle_exception(self.ignore_callback_errors,

~\Anaconda3\lib\site-packages\vispy\scene\canvas.py in on_draw(self, event)
    215         # scheduling of further updates
    216         self._update_pending = False
--> 217         self._draw_scene()
    218 
    219     def render(self, region=None, size=None, bgcolor=None, crop=None):

~\Anaconda3\lib\site-packages\vispy\scene\canvas.py in _draw_scene(self, bgcolor)
    264             bgcolor = self._bgcolor
    265         self.context.clear(color=bgcolor, depth=True)
--> 266         self.draw_visual(self.scene)
    267 
    268     def draw_visual(self, visual, event=None):

~\Anaconda3\lib\site-packages\vispy\scene\canvas.py in draw_visual(self, visual, event)
    302                         else:
    303                             if hasattr(node, 'draw'):
--> 304                                 node.draw()
    305                                 prof.mark(str(node))
    306                 else:

~\Anaconda3\lib\site-packages\vispy\scene\visuals.py in draw(self)
     97         if self.picking and not self.interactive:
     98             return
---> 99         self._visual_superclass.draw(self)
    100 
    101 

~\Anaconda3\lib\site-packages\vispy\visuals\visual.py in draw(self)
    593         for v in self._subvisuals:
    594             if v.visible:
--> 595                 v.draw()
    596 
    597     def _prepare_draw(self, view):

~\Anaconda3\lib\site-packages\vispy\scene\visuals.py in draw(self)
     97         if self.picking and not self.interactive:
     98             return
---> 99         self._visual_superclass.draw(self)
    100 
    101 

~\Anaconda3\lib\site-packages\vispy\visuals\visual.py in draw(self)
    433             return
    434         self._configure_gl_state()
--> 435         if self._prepare_draw(view=self) is False:
    436             return
    437 

~\Anaconda3\lib\site-packages\vispy\visuals\text\text.py in _prepare_draw(self, view)
    527             self._vertices = np.concatenate([
    528                 _text_to_vbo(t, self._font, self._anchors[0], self._anchors[1],
--> 529                              self._font._lowres_size) for t in text])
    530             self._vertices = VertexBuffer(self._vertices)
    531             idx = (np.array([0, 1, 2, 0, 2, 3], np.uint32) +

~\Anaconda3\lib\site-packages\vispy\visuals\text\text.py in <listcomp>(.0)
    527             self._vertices = np.concatenate([
    528                 _text_to_vbo(t, self._font, self._anchors[0], self._anchors[1],
--> 529                              self._font._lowres_size) for t in text])
    530             self._vertices = VertexBuffer(self._vertices)
    531             idx = (np.array([0, 1, 2, 0, 2, 3], np.uint32) +

~\Anaconda3\lib\site-packages\vispy\visuals\text\text.py in _text_to_vbo(text, font, anchor_x, anchor_y, lowres_size)
    176     # vertical alignment can be very inconsistent
    177     for char in 'hy':
--> 178         glyph = font[char]
    179         y0 = glyph['offset'][1] * ratio + slop
    180         y1 = y0 - glyph['size'][1]

~\Anaconda3\lib\site-packages\vispy\visuals\text\text.py in __getitem__(self, char)
     79             raise TypeError('index must be a 1-character string')
     80         if char not in self._glyphs:
---> 81             self._load_char(char)
     82         return self._glyphs[char]
     83 

~\Anaconda3\lib\site-packages\vispy\visuals\text\text.py in _load_char(self, char)
     93         assert char not in self._glyphs
     94         # load new glyph data from font
---> 95         _load_glyph(self._font, char, self._glyphs)
     96         # put new glyph into the texture
     97         glyph = self._glyphs[char]

~\Anaconda3\lib\site-packages\vispy\util\fonts\_freetype.py in _load_glyph(f, char, glyphs_dict)
     45 def _load_glyph(f, char, glyphs_dict):
     46     """Load glyph from font into dict"""
---> 47     from freetype import (FT_LOAD_RENDER, FT_LOAD_NO_HINTING,
     48                           FT_LOAD_NO_AUTOHINT)
     49     flags = FT_LOAD_RENDER | FT_LOAD_NO_HINTING | FT_LOAD_NO_AUTOHINT

~\Anaconda3\lib\site-packages\freetype\__init__.py in <module>
     22 import struct
     23 
---> 24 from freetype.raw import *
     25 
     26 # Hack to get unicode class in python3

~\Anaconda3\lib\site-packages\freetype\raw.py in <module>
     50 except (OSError, TypeError):
     51     _lib = None
---> 52     raise RuntimeError('Freetype library not found')
     53 
     54 FT_Init_FreeType       = _lib.FT_Init_FreeType

RuntimeError: Freetype library not found

However, it seems there is no error when I run this one:

from skimage import data
import napari

viewer = napari.view_image(data.astronaut(), rgb=True)
points = np.array([[100, 100], [200, 200], [300, 100]])
viewer.add_points(points, size=30)

I would appreciate your help with this.

@Mas_Developer interesting! I wonder whether you are running things on different environments? And, can you share the complete code for the one that is failing? It looks like just a subset of the one that is working so the error can’t be there…

@jni, I am using Jupyter notebook:

  • scipy=1.4.1
  • pyvista=0.25.3
  • pandas=1.0.1
  • open3d=0.8.0.0
  • numpy=1.18.1
  • napari=0.3.6
  • matplotlib=3.1.3
  • itk==5.1.0.post3
  • Python = 3.7.6 *Edited

Here is the complete code that is failing :

import napari
import numpy as np
%gui qt5
napari.gui_qt()
viewer=napari.Viewer()

points = np.array([[100, 100], [200, 200], [300, 100]])
viewer.add_points(points, size=30)

It actually does add points to the viewer but also shows this error!

This is the full code that works well :

from skimage import data
import napari

viewer = napari.view_image(data.astronaut(), rgb=True)
points = np.array([[100, 100], [200, 200], [300, 100]])
viewer.add_points(points, size=30)

Hi @Mas_Developer, sorry that you’re running into this problem! It does seem like a funky one

Before diving into the bug, a quick side note, in the first example you seem to be using both %gui qt5 (which you only need if launching from IPython or a Jupyter notebook) and napari.gui_qt() (which would only use from a script and you’d want to use with a with statement as a context manager), and you shouldn’t need to use both together. As it sounds like you are using Jupyter, you can drop the napari.gui_qt call. You can read more about that in our getting started tutorial.

With all that said, as mentioned above, I don’t actually think that is where your problem is coming from. I suspect the following minimal example captures your bug pretty well

import napari
import numpy as np

with napari.gui_qt():
    viewer=napari.Viewer()

    # viewer.add_image(np.random.random((400, 400))) # Uncomment line to avoid crash :-)
    points = np.array([[100, 100], [200, 200], [300, 100]])
    viewer.add_points(points, size=30)

where adding the points to an empty viewer causes the crash.

Looking at the stack trace and googling vispy errors, this looks to be a vispy windows bug, that maybe related to the one discussed here https://github.com/vispy/vispy/issues/1276 I can’t look into this more right now, but I wonder if some of our windows users like @haesleinhuepf or @cgohlke have encountered this or have ideas.

2 Likes

Hey @Mas_Developer,
CC-Hey @sofroniewn,

I just failed to reproduce the error in fresh conda environment in Windows 10 with the dependencies listed above. But I remember, I had this bug earlier. Back in the days, I ended up on stackoverflow where links point towards installing the Freetype library by hand, e.g. from this github resource. Of course, this is just a workaround, but it goes in line with the github-issue @sofroniewn mentioned.
Just out of curiousity, @Mas_Developer what python version do you have installed?

Let us know if this helps!

Cheers,
Robert

1 Like

Thanks Robert. I am using Python 3.7.6.

2 Likes