Я продолжаю получать JSONDecodeError при попытке импортировать matplotlib в блокнот Jupyter - PullRequest
0 голосов
/ 23 июня 2019

Когда я пытаюсь импортировать matplotlib.pyplot как plt в блокноте Jupyter я получаю следующую ошибку: JSONDecodeError Я не знаю, как поступить, и попробовал несколько решений. Стоит ли переустанавливать conda? Я новичок и использую установщик conda или кузницу. Может быть, я должен был использовать pyp? Хотя я не осознаю разницу?

JSONDecodeError                           Traceback (most recent call last)
~\Anaconda3\lib\site-packages\matplotlib\font_manager.py in <module>
   1355         try:
-> 1356             fontManager = json_load(_fmcache)
   1357             if (not hasattr(fontManager, '_version') or

~\Anaconda3\lib\site-packages\matplotlib\font_manager.py in json_load(filename)
    891     with open(filename, 'r') as fh:
    --> 892         return json.load(fh, object_hook=_json_decode)
    893 

~\Anaconda3\lib\json\__init__.py in load(fp, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
    295         parse_float=parse_float, parse_int=parse_int,
--> 296         parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
    297 

~\Anaconda3\lib\json\__init__.py in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
    360         kw['parse_constant'] = parse_constant
--> 361     return cls(**kw).decode(s)

~\Anaconda3\lib\json\decoder.py in decode(self, s, _w)
    336         """
--> 337         obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    338         end = _w(s, end).end()

~\Anaconda3\lib\json\decoder.py in raw_decode(self, s, idx)
    352         try:
--> 353             obj, end = self.scan_once(s, idx)
    354         except StopIteration as err:

JSONDecodeError: Expecting ':' delimiter: line 4366 column 13 (char 110387)

During handling of the above exception, another exception occurred:

TimeoutError                              Traceback (most recent call last)
<ipython-input-6-a0d2faabd9e9> in <module>
----> 1 import matplotlib.pyplot as plt

~\Anaconda3\lib\site-packages\matplotlib\pyplot.py in <module>
     30 from cycler import cycler
     31 import matplotlib
---> 32 import matplotlib.colorbar
     33 import matplotlib.image
     34 from matplotlib import rcsetup, style

~\Anaconda3\lib\site-packages\matplotlib\colorbar.py in <module>
     30 import matplotlib.collections as collections
     31 import matplotlib.colors as colors
---> 32 import matplotlib.contour as contour
     33 import matplotlib.cm as cm
     34 import matplotlib.gridspec as gridspec

~\Anaconda3\lib\site-packages\matplotlib\contour.py in <module>
     16 import matplotlib.colors as mcolors
     17 import matplotlib.collections as mcoll
---> 18 import matplotlib.font_manager as font_manager
     19 import matplotlib.text as text
     20 import matplotlib.cbook as cbook

~\Anaconda3\lib\site-packages\matplotlib\font_manager.py in <module>
   1364             raise
   1365         except Exception:
-> 1366             _rebuild()
   1367     else:
   1368         _rebuild()

~\Anaconda3\lib\site-packages\matplotlib\font_manager.py in _rebuild()
   1348 
   1349         if _fmcache:
-> 1350             with cbook._lock_path(_fmcache):
   1351                 json_dump(fontManager, _fmcache)
   1352         _log.debug("generated new fontManager")

~\Anaconda3\lib\contextlib.py in __enter__(self)
    110         del self.args, self.kwds, self.func
    111         try:
--> 112             return next(self.gen)
    113         except StopIteration:
    114             raise RuntimeError("generator didn't yield") from None

~\Anaconda3\lib\site-packages\matplotlib\cbook\__init__.py in _lock_path(path)
   1855 This maybe due to another process holding this lock file.  If you are sure no
   1856 other Matplotlib process is running, remove this file and try again.""".format(
-> 1857             lock_path))
   1858     try:
   1859         yield

TimeoutError: Lock error: Matplotlib failed to acquire the following lock file:
    C:\Users\matij\.matplotlib\fontlist-v300.json.matplotlib-lock
This maybe due to another process holding this lock file.  If you are sure no

запущен другой процесс Matplotlib, удалите этот файл и повторите попытку.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...