首页 > 解决方案 > 导入 matplotlib 的安全策略错误

问题描述

安装 matplotlib 后。使用此命令时出现此错误:

$ import matplotlib
import-im6.q16: attempt to perform an operation not allowed by the security policy `PS` @ error/constitute.c/IsCoderAuthorized/408.

谁能帮我解决这个问题?

标签: pythonmatplotlibinstallation

解决方案


如果我import从 shell 运行,这会发生在我身上。示范:

$ import
import-im6.q16: missing an image filename `import' @ error/import.c/ImportImageCommand/1289.

这个askubuntu问题告诉我这import是一个内置的 ImageMagick 命令。

解决方案

您首先必须启动 Python 交互式提示:

python
>>> import matplotlib

推荐阅读