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.

Recommendation

Python version 3.8.12 and higher is recommended

Settings up Python

  1. Download Anaconda from official site and install it (both versions 2.7 and 3.8 are supported). You can also install regular Python from official sites.
  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.

Setting up pylint

  1. Check if you have already installed pylint. If so continue to #8
  2. If you are missing pylint make sure you have installed pip. If you have installed pip continue to #7
  3. Install pip. Go to python folder and navigate to Scripts subfolder
  4. Run command

    curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
  5. Navigate to folder where python.exe is located. Should be in parrent folder.
  6. Run command and specify path to file downloaded in 4th step

    python.exe Scripts\get-pip.py
  7. Navigate back to Script folder and run command to install pylint

    pip install pylint
  8. Open BellaDati ML Studio and go to Settings. Same as in #3 in Setting up Python
  9. Paste the path to pylint.exe to "Path to Pylint" field.
  10. Save the Settings.


You can install any additional dependencies in Script folder using

pip install <module_name>


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.

Examples 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).


linux ubuntu Python

Detail description see Python installation -linux Ubuntu page

  • No labels