我想打印rcParams
来查看程序各阶段的设置。
以下是我的进口:
import matplotlib as mpl
from matplotlib import rcParams
字符串
我试过以下方法:print(mpl.rcParamsDefault)
、print(mpl.rcParams)
和print(rcParams)
对于这三个,我得到了相同的错误消息:
Traceback (most recent call last):
File "e:\Minitab_Killer\rcParams_print_out.py", line 1, in <module>
import matplotlib as mpl
File "C:\Users\D\miniconda3\lib\site-packages\matplotlib\__init__.py", line 107, in <module>
from . import _api, cbook, docstring, rcsetup
File "C:\Users\D\miniconda3\lib\site-packages\matplotlib\rcsetup.py", line 24, in <module>
from matplotlib import _api, animation, cbook
File "C:\Users\D\miniconda3\lib\site-packages\matplotlib\animation.py", line 34, in <module>
from PIL import Image
File "C:\Users\D\miniconda3\lib\site-packages\PIL\Image.py", line 103, in <module>
from . import _imaging as core
ImportError: DLL load failed while importing _imaging: The specified module could not be found.
型
我发现了这个answer,有些人通过修复他们的pillow
安装来解决这个问题。我正在使用anaconda
,所以我运行conda install -c anaconda pillow
命令,它更新了pillow
,但错误消息没有改变。
我尝试了这个answer和运行pip install --force pillow
,同样的错误消息。
当我尝试pip
的答案时,我想要一个纯conda
的解决方案。
从conda list
这里是相关的软件包:python 3.10.9
,pillow 9.4.0
,matplotlib 3.5.3
。
更新:
尝试this:pip install --force pillow
和this:Pillow 9.0.0
,得到以下错误:
Traceback (most recent call last):
File "e:\Minitab_Killer\rcParams_print_out.py", line 2, in <module>
from matplotlib import rcParams
File "C:\Users\D\miniconda3\lib\site-packages\matplotlib\__init__.py", line 107, in <module>
from . import _api, cbook, docstring, rcsetup
File "C:\Users\D\miniconda3\lib\site-packages\matplotlib\rcsetup.py", line 24, in <module>
from matplotlib import _api, animation, cbook
File "C:\Users\D\miniconda3\lib\site-packages\matplotlib\animation.py", line 34, in <module>
from PIL import Image
File "C:\Users\D\miniconda3\lib\site-packages\PIL\Image.py", line 103, in <module>
from . import _imaging as core
ImportError: DLL load failed while importing _imaging: The specified module could not be found.
型
接下来我应该尝试什么?
1条答案
按热度按时间pinkon5k1#
我在GitHub here上发布了一个bug报告。
事实证明这不是一个bug。Andrew Murray提供了多种方法来尝试解决问题,在我的情况下,
conda upgrade conda
解决了我的问题。