Raspberry Pi 没有找到名为 Plotly 的模块。

huangapple go评论48阅读模式
英文:

Raspberry Pi No module named Plotly

问题

我在Raspberry Pi上安装了plotly。目标是连接到远程的MySql数据库并绘制交互式的时间序列图(当新数据到达MySql数据库时会更新)。但是即使在安装了plotly之后,我仍然遇到了no module found的问题。看起来像是pip install plotly正在为python 2.7安装这个包(如下面的屏幕截图所示),但我在使用3.3(最新版本)。我应该如何为最新版本的Python安装这个包。

屏幕截图显示了模块的安装,然后将此模块导入Python脚本中:

Raspberry Pi 没有找到名为 Plotly 的模块。

英文:

I have installed plotly on the Raspberry Pi. The objective is connecting to a remote MySql database and plot interactive time-series plots (that would update as the new data arrives into the MySql database). But I am running into no module found even after installing it. Looks like the pip install plotly is installing the package for python 2.7 (below screenshot) but I am using 3.3 (latest). How do I install the package for latest Python version.

Screenshot shows, installation of the module and then importing this module into the Python script:
Raspberry Pi 没有找到名为 Plotly 的模块。

答案1

得分: 2

有多个 Python 版本在您的计算机上,并且 pip 命令似乎指向 Python 2.7 版本。您可以使用以下命令将 pip 指向所需的 Python 安装位置:

python3 -m pip install plotly

这将使用与 python3 相关联的 pip

英文:

There are multiple python versions on your machine, and the pip command seems to be pointing to python version 2.7. You can point pip to your desired python installation with the following command:

python3 -m pip install plotly

This will use the pip that is associated with python3.

答案2

得分: 1

并不直接回答你的问题。但由于你在处理时间序列数据,你可以考虑使用时间序列数据库而不是MySQL,并且使用Grafana来可视化数据。

英文:

Not directly to your question. But since you are dealing with time-series data, you may consider Time Series DB instead of MySQL, and visualize the data with Grafana.

huangapple
  • 本文由 发表于 2023年2月14日 02:59:33
  • 转载请务必保留本文链接:https://go.coder-hub.com/75440166.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定