python - ImportError:无法从“pypfopt.plotting”导入名称“Plotting”
问题描述
我刚刚安装了 pyportfolioopt 模块,但在执行以下导入时出错
from pypfopt.plotting import Plotting
错误是
ImportError: cannot import name 'Plotting' from 'pypfopt.plotting'
我已经从https://pyportfolioopt.readthedocs.io/en/latest/Plotting.html检查了 API,但没有看到任何名为“Plotting”的类。
请指教。
解决方案
你必须使用
from pypfopt import plotting
代替
from pypfopt.plotting import Plotting
推荐阅读
- java - PSQLException:错误:“id”列中的空值在 SQL 插入期间违反了非空约束
- mysql - 使用 SQL 从 WordPress 帖子中删除 HTML 失败且没有错误
- blogger - 如何将两个小部件内容包装到 Blogger 中的单个 DIV 元素中?
- java - 为什么内部具有类对象数组的构造函数具有空值
- git - 通配符文件忽略在 .talismanrc 中不起作用
- python - Plotly:如何在 scattergeo 图中自定义标签?
- machine-learning - ValueError:无法将 NumPy 数组转换为张量(不支持的对象类型 numpy.ndarray)。在 CNN 网络的猫狗分类中发展
- javascript - 如何在 Sublime text 3 中同时使用 JavaScript 和 HTML?
- tooltip - Meteor 在两个 claases/elements 上使用tippy.js
- user-interface - KARATE UI:如何将动态值传递给定位器和断言?