Two years after I wrote the article on how to set up the Python machine learning backend for Moodle Analytics and I got a comment that the method I described does not work anymore because the Python version has changed and the new moodlemlbackend 3.0.5 requires new Python libs.

So here are the new steps to set up moodlemlbackend 3.0.5 on Python 3.6.

Step 1.

  1. Login to your cPanel account.
  2. Click on “Setup Python App”
cPanel dashboard
cPanel dashboard

Step 2.

The new moodlemlbackend supports Python 3.6 now.

  1. Select Python 3.6 version from the drop-down list.
  2. Specify your Application root (eg. analytics).
  3. Specify your Application URL (eg. analytics). Do not leave it empty!
  4. Click “CREATE” button.
cPanel - Python - Create application
cPanel – Python – Create application

Step 3.

This part was easier with the previous version of moodlemlbackend. That time, the moodlemlbackend did the job for you but now it does not.

Failed setup of moodlemlbackend
Failed setup of moodlemlbackend

So we need to do the job ourselves. These steps are based on the moodlehq/moodle-mlbackend-python/ guide.

First, install the new pip. Type:

$ pip install -U pip
Installing new pip
Installing new pip

Then install the required modules.

$ pip install tensorflow sklearn numpy matplotlib boto3
Successfully installed the  required Python packages
Successfully installed the required Python packages

Now we can install moodlemlbackend.

$ pip install moodlemlbackend
Installing moodlemlbackend 3.0.5
Installing moodlemlbackend 3.0.5
moodlemlbackend successfully installed
moodlemlbackend successfully installed

And now you can setup the Analyitics in Moodle.


Leave a comment

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload the CAPTCHA.