admin管理员组文章数量:1122846
Had this error
{
"name": "ImportError",
"message": "cannot import name '_c_internal_utils' from partially initialized module 'matplotlib' (most likely due to a circular import) (c:\\Users\\Lenovo\\miniconda3\\envs\\lastresort\\Lib\\site-packages\\matplotlib\\__init__.py)",
"stack": "---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
Cell In[3], line 2
1 import os
----> 2 import matplotlib.pyplot as plt
3 from matplotlib.pyplot import imshow
5 import numpy as np
File c:\\Users\\Lenovo\\miniconda3\\envs\\lastresort\\Lib\\site-packages\\matplotlib\\__init__.py:159
155 from packaging.version import parse as parse_version
157 # cbook must import matplotlib only within function
158 # definitions, so it is safe to import from it here.
--> 159 from . import _api, _version, cbook, _docstring, rcsetup
160 from matplotlib.cbook import sanitize_sequence
161 from matplotlib._api import MatplotlibDeprecationWarning
File c:\\Users\\Lenovo\\miniconda3\\envs\\lastresort\\Lib\\site-packages\\matplotlib\\cbook.py:32
29 from numpy import VisibleDeprecationWarning
31 import matplotlib
---> 32 from matplotlib import _api, _c_internal_utils
35 def _get_running_interactive_framework():
36 \"\"\"
37 Return the interactive framework whose event loop is currently running, if
38 any, or \"headless\" if no event loop can be started, or None.
(...)
44 \"macosx\", \"headless\", ``None``.
45 \"\"\"
ImportError: cannot import name '_c_internal_utils' from partially initialized module 'matplotlib' (most likely due to a circular import) (c:\\Users\\Lenovo\\miniconda3\\envs\\lastresort\\Lib\\site-packages\\matplotlib\\__init__.py)"
}
and checked every other question existing like this but has different conditions. Before downgrading to python 3.11 matplotlib still works, I need to downgrade to 3.11 because 3.12 and 3.13 has requirement error (tensorflow-cpu in not exist in 3.12, cgi not exist since 3.11 or something that needs me to downgrade from 3.13)
Reinstalled Matplotlib and update it and still not working
Checked other forum this might be OS related and related to C++ engines, any possible solution?
Had this error
{
"name": "ImportError",
"message": "cannot import name '_c_internal_utils' from partially initialized module 'matplotlib' (most likely due to a circular import) (c:\\Users\\Lenovo\\miniconda3\\envs\\lastresort\\Lib\\site-packages\\matplotlib\\__init__.py)",
"stack": "---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
Cell In[3], line 2
1 import os
----> 2 import matplotlib.pyplot as plt
3 from matplotlib.pyplot import imshow
5 import numpy as np
File c:\\Users\\Lenovo\\miniconda3\\envs\\lastresort\\Lib\\site-packages\\matplotlib\\__init__.py:159
155 from packaging.version import parse as parse_version
157 # cbook must import matplotlib only within function
158 # definitions, so it is safe to import from it here.
--> 159 from . import _api, _version, cbook, _docstring, rcsetup
160 from matplotlib.cbook import sanitize_sequence
161 from matplotlib._api import MatplotlibDeprecationWarning
File c:\\Users\\Lenovo\\miniconda3\\envs\\lastresort\\Lib\\site-packages\\matplotlib\\cbook.py:32
29 from numpy import VisibleDeprecationWarning
31 import matplotlib
---> 32 from matplotlib import _api, _c_internal_utils
35 def _get_running_interactive_framework():
36 \"\"\"
37 Return the interactive framework whose event loop is currently running, if
38 any, or \"headless\" if no event loop can be started, or None.
(...)
44 \"macosx\", \"headless\", ``None``.
45 \"\"\"
ImportError: cannot import name '_c_internal_utils' from partially initialized module 'matplotlib' (most likely due to a circular import) (c:\\Users\\Lenovo\\miniconda3\\envs\\lastresort\\Lib\\site-packages\\matplotlib\\__init__.py)"
}
and checked every other question existing like this but has different conditions. Before downgrading to python 3.11 matplotlib still works, I need to downgrade to 3.11 because 3.12 and 3.13 has requirement error (tensorflow-cpu in not exist in 3.12, cgi not exist since 3.11 or something that needs me to downgrade from 3.13)
Reinstalled Matplotlib and update it and still not working
Checked other forum this might be OS related and related to C++ engines, any possible solution?
Share Improve this question asked Nov 22, 2024 at 10:44 RedSeanRedSean 338 bronze badges1 Answer
Reset to default 0Fixed by uninstalling matplotlib and installing matplotlib again in usual way, if necessary, delete files in ./miniconda3/envs/{env-name}/Lib/site-packages/
Will gladly edit if other details are found by other people or means
本文标签: python 3xImport Error Matplotlib require 39cinternalutils39 and actually using condaStack Overflow
版权声明:本文标题:python 3.x - Import Error Matplotlib require '_c_internal_utils' and actually using conda - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736304398a1932219.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论