简体   繁体   English

与Pycharm一起使用Plotly

[英]using Plotly with pycharm

I am trying to use Plotly with pycharm when I run the code (which I toke from the Ploty getting started page on terminal it is OK but when I use it with pycharm I get error: 我在运行代码时尝试将Plotlypycharm一起使用(我从终端上的Ploty入门页面上拨了它就可以了,但是当我将其与pycharm一起使用时出现错误:

"ImportError: No module named 'plotly.graph_objs'; 'plotly' is not a packageé" “ ImportError:没有名为'plotly.graph_objs'的模块;'plotly'不是软件包”

Code on pycharm pycharm上的代码

Any idea about where could be the problem ? 关于哪里可能有问题的任何想法吗? because plotly module works on terminal and not on the editor could this problem be related to what is evoqued in this question ? 因为plotly模块在终端而不是在编辑器上工作,所以这个问题可能与这个问题有关吗?

Blockquote Python dynamic objects not defined anywhere? 没有在任何地方定义的 Blockquote Python动态对象? (Plotly lib) (情节lib)

Thx 谢谢

Your script is named plotly.py . 您的脚本命名为plotly.py In the first line where you import plotly it loads your script and not the plotly package. 在您导入绘图的第一行中,它会加载脚本,而不是plotly程序包。 Change the name of your script to plot.py or something other than plotly and it should work. 将脚本的名称更改为plot.py或plotly以外的名称,它应该可以工作。

In Pycharm you have to download it. 在Pycharm中,您必须下载它。

Go to File --> Settings -->Project --> Project Interpreter --> on the plus right site--> search for your module and download it! 转到文件->设置->项目->项目解释器->在正确的站点上->搜索您的模块并下载它!

Thats it!! 而已!!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM