Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Sv translation
languageen

In BellaDati ML Studio it is possible to use Python libraries and scripts. To be able to use them, Anaconda needs to be installed on the server.

Info
titleRecommendation

Python version 3.8.12 and higher is recommended

Settings up Anaconda for Python

  1. Download Anaconda from official site and install it (both versions 2.7 and 3.7 are supported).
  2. Copy path to file python.exe which is located in the folder where Anaconda was installed (for example C:\Anaconda2\python.exe or /usr/bin/python).
  3. Open BellaDati ML Studio and go to Settings.
     
  4. Paste the path to python.exe to "Path to Python executable" field.
  5. Save the Settings.

Adding and removing Python Scripts in Projects

Python scripts can be attached to a project by uploading them from the Files sections.

It is also possible to remove the file from the project by clicking on the delete icon.

USING PYTHON SCRIPTS IN PROJECTS

Python script can be executed from the code by using function executePythonScript(). This function is used with several parameters. The first one is mandatory and it is always the Python script, either name of the file or directly the Python code. The rest of parameters if optional. It can be InputStream parameter and (or) any number of String parameters.

Code Block
languagejava
titleExamples of function executePythonScript()
executePython(String script, String... params)
executePython(String script, InputStream is, String... params)
executePythonScript(String file, String... params)
executePythonScript(String file, InputStream is, String... params)

Troubleshooting

Error "Python executable is not defined or does not exist." is displayed.

Please make sure that you have set the correct path to the file python.exe. This error can also happen when BellaDati cannot access the file because it does not have correct access rights, e. g. when the Anaconda folder is located inside user's home directory (C:\Users\nameofuser\Anaconda2).


Tip
titlelinux ubuntu Python

Detail description see Python installation -linux Ubuntu page


Sv translation
languageja

BellaDati ML Studioでは、Pythonライブラリとスクリプトを使用できます。それらを使用できるようにするには、Anacondaをサーバーにインストールする必要があります。

PythonのAnaconda環境構築

  1. 公式サイトからAnacondaをダウンロードしてインストールします(バージョン2.7と3.7の両方がサポートされています)。

  2. Anacondaがインストールされたフォルダーにあるpython.exeファイルへのパスをコピーします(例えば、C:\Anaconda2\python.exeまたは/usr/bin/python)。
  3. BellaDati ML Studioを開き、 設定に移動します。
     
  4. python.exeへのパスを「Path to Python executable」フィールドに貼り付けます。

  5. 設定を保存します。

プロジェクトでのPythonスクリプトの追加と削除

Pythonスクリプトは、ファイルセクションからアップロードすることでプロジェクトに添付できます。

削除アイコンをクリックして、プロジェクトからファイルを削除することもできます。

プロジェクトでのPYTHONスクリプトの使用

Pythonスクリプトは、executePythonScript()関数を使用してコードから実行できます。この関数はいくつかのパラメーターとともに使用されます。最初のパラメーターえは必須で、常にPythonスクリプトであり、ファイル名か直接Pythonコードを使用します。残りのパラメーターはオプションです。 InputStreamパラメーターおよび(または)任意の数のStringパラメーターにすることができます。

Code Block
languagejava
titleExamples of function executePythonScript()
executePython(String script, String... params)
executePython(String script, InputStream is, String... params)
executePythonScript(String file, String... params)
executePythonScript(String file, InputStream is, String... params)

 

トラブルシューティング

「Python実行可能ファイルが定義されていないか、存在しません。」エラーが表示されています。

python.exeファイルへの正しいパスを設定したことを確認してください。このエラーは、BellaDatiが正しいアクセス権を持っていないためにファイルにアクセスできない場合にも発生します。例えば、Anacondaフォルダーがユーザーのホームディレクトリ内にある場合(C:\Users\ nameofuser\Anaconda2)。(C:\Users\nameofuser\Anaconda2).

...