简体   繁体   English

在 Spyder ModuleNotFoundError 中:没有名为“plotly”的模块

[英]in Spyder ModuleNotFoundError: No module named 'plotly'

New to python.蟒蛇新手。 Not sure how to to add a module.不知道如何添加模块。

import plotly.express as px

Error:错误:

ipdb> ModuleNotFoundError: No module named 'plotly'

What steps are need to have this module recognised?需要哪些步骤才能识别此模块?

What worked for me, both under Windows and under MacOSX , is using Anaconda for all Python apps.WindowsMacOSX下对我有用的是将Anaconda用于所有Python应用程序。 This post also advises to use Anaconda :这篇文章还建议使用Anaconda
Python dependency hell: A compromise between virtualenv and global dependencies? Python 依赖地狱:virtualenv 和全局依赖之间的妥协?

I also found this article to be useful:我还发现这篇文章很有用:
https://github.com/spyder-ide/spyder/wiki/Working-with-packages-and-environments-in-spyder https://github.com/spyder-ide/spyder/wiki/Working-with-packages-and-environments-in-spyder

These are the steps I took.这些是我采取的步骤。

  • Install Anaconda :安装蟒蛇
    https://docs.anaconda.com/anaconda/user-guide/getting-started/ https://docs.anaconda.com/anaconda/user-guide/getting-started/

  • Under Windows , open the Anaconda cmd prompt from the Anaconda Navigator .Windows 下,从Anaconda Navigator打开Anaconda cmd 提示符。 Under MacOSX , just open the cmd prompt.MacOSX 下,只需打开 cmd 提示符。

  • In the cmd prompt, install plotly with this command:在 cmd 提示符下,使用以下命令安装plotly

     conda install plotly

    This installs plotly in the Anaconda environment.这在蟒蛇环境plotly安装。

  • Launch Spyder from the Anaconda Navigator .Anaconda Navigator启动Spyder Always launch Spyder from the Anaconda Navigator , to make sure you're running the copy of Spyder from the Anaconda environment.始终从Anaconda Navigator启动Spyder ,以确保您正在从Anaconda环境运行Spyder的副本。

  • In a Python script, load plotly :在 Python 脚本中,加载plotly

     import plotly as py

After that you should be good to go with plotly .在那之后,你应该很好地使用plotly

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

相关问题 ModuleNotFoundError:没有名为“plotly”的模块 - ModuleNotFoundError: No module named 'plotly' ModuleNotFoundError:spyder 中没有名为“pip”的模块 - ModuleNotFoundError: No module named 'pip' in spyder ModuleNotFoundError:Spyder 上没有名为“selenium”的模块 - ModuleNotFoundError: No module named 'selenium' on Spyder ModuleNotFoundError:anaconda spyder 中没有名为“pyLDAvis”的模块 - ModuleNotFoundError: No module named 'pyLDAvis' in anaconda spyder spyder3:“ ModuleNotFoundError:没有名为'simplegeneric'的模块” - spyder3: “ModuleNotFoundError: No module named 'simplegeneric'” ModuleNotFoundError:没有名为“spyder.utils.iofuncs”的模块 - ModuleNotFoundError: No module named 'spyder.utils.iofuncs' ModuleNotFoundError:没有名为“ cx_Oracle” spyder的模块 - ModuleNotFoundError: No module named 'cx_Oracle' spyder ModuleNotFoundError:没有名为“django_plotly_dash”的模块 - ModuleNotFoundError: No module named 'django_plotly_dash' ModuleNotFoundError:没有名为“plotly.graph_objects”的模块 - ModuleNotFoundError: No module named 'plotly.graph_objects' ModuleNotFoundError:Ubuntu Spyder 5.3.0 中没有名为“qdarkstyle.colorsystem”的模块 - ModuleNotFoundError: No module named 'qdarkstyle.colorsystem' in Ubuntu Spyder 5.3.0
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM