英文:
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脚本中:
英文:
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:
答案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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论