[英]Orange with MySQL data import
I've got data in a MySQL DB and would like to get it into Orange.我在 MySQL 数据库中有数据,并希望将其放入 Orange。 So I install Orange 2.7, starting orange-canvas and how would I go on now?所以我安装了 Orange 2.7,开始使用 orange-canvas,现在我该怎么做?
There are Add-Ons for MySQL: https://github.com/biolab/orange/tree/master/Orange/orng but how are they being installed? MySQL 有附加组件: https : //github.com/biolab/orange/tree/master/Orange/orng但它们是如何安装的? (and where?) (在哪里?)
And if installed - how can I connect them to a Data Table component?如果已安装 - 如何将它们连接到数据表组件?
These are not add-ons but modules you already have.这些不是附加组件,而是您已经拥有的模块。 See documentationhttp://docs.orange.biolab.si/reference/rst/Orange.data.sql.html请参阅文档http://docs.orange.biolab.si/reference/rst/Orange.data.sql.html
If you want to access SQL from canvas, open Preferences / Categories and enable Prototypes.如果要从画布访问 SQL,请打开 Preferences / Categories 并启用 Prototypes。 This will add a new widget category with a lot of weird experimental stuff.这将添加一个新的小部件类别,其中包含许多奇怪的实验性内容。 There are two different widgets for fetching data from SQL.有两种不同的小部件可用于从 SQL 获取数据。
Orange 3 (still very much in beta, though) has a much better support for DB, but for now only for Postgres. Orange 3(尽管仍处于测试阶段)对 DB 有更好的支持,但目前仅支持 Postgres。 If you don't mind switching, you should check it.如果你不介意切换,你应该检查一下。
我使用的解决方法如下: 1. php 代码查询mysql 数据库,并创建一个制表符分隔文件(Orange 之外) 2. 在Orange 中使用python 脚本,使用pandas 加载数据。
Let me try to answer your second question, "How are Add-Ons being installed?", in respect to the first one, for Orange3 (assuming that you upgraded in the meantime):让我试着回答你的第二个问题,“如何安装附加组件?”,关于第一个问题,对于 Orange3(假设你在此期间升级):
Orange3 is distributed with its own Python framework, including the pip
binary (a package installer, "pip installs packages"). Orange3 随其自己的 Python 框架一起分发,包括pip
二进制文件(一个包安装程序,“pip 安装包”)。
The Orange3 docs [1] tell us which python module to take: pymssql
. Orange3 文档 [1] 告诉我们要采用哪个 python 模块: pymssql
。
In my case, on MacOS, the installation path is /Applications/Orange3.app/
.就我而言,在 MacOS 上,安装路径是/Applications/Orange3.app/
。
So,所以,
/Applications/Orange3.app/Contents/MacOS/pip install pymssql
/Applications/Orange3.app/Contents/MacOS/pip install Cython /Applications/Orange3.app/Contents/MacOS/pip install "pymssql<3.0"
HT still H HT 还是 H
[1] https://orange-visual-programming.readthedocs.io/widgets/data/sqltable.html [1] https://orange-visual-programming.readthedocs.io/widgets/data/sqltable.html
conda install pymssql
对我conda install pymssql
,它在 SQL 表配置中启用了“SQL Server”,但是我还没有能够让 mysql 连接器工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.