Install script Django - Missing command python

I buy Virtulamin 6.14 Pro version for running Django.

Tried to install on virtual serveris with Available Scripts -> Django 1.9.7 and I get this error message.

This script cannot be installed, as this virtual server does not meet its requirements : The python command is not installed, Could not work out Python version : sh: 1: --version: not found , Missing command python

Tried to google this problem but at the moment without any luck.

Fixed (pending)
Virtualmin version: 
Webmin version: 


Ilia's picture
Submitted by Ilia on Tue, 01/19/2021 - 03:47


The simple work-around would be is to go to Virtualmin Configuration and set default Python command to python3 in Advanced Options.

Ilia's picture
Submitted by Ilia on Tue, 01/19/2021 - 04:02

Next Virtualmin release will have it working the right way out of the box.

Thanks for reporting.

When I start to install script then get this error:

Reading package lists...
Building dependency tree...
Reading state information...
Package python-mysqldb is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'python-mysqldb' has no installation candidate

I fix with

sudo apt-get install python3-mysqldb

but then:

Now installing Django version 1.9.7 ..

    DB initialization install failed :

    Traceback (most recent call last):
      File "", line 10, in 
      File "/home/moskovskaya/public_html/lib/python/Django-1.9.7-py3.8.egg/django/core/management/", line 353, in execute_from_command_line
      File "/home/moskovskaya/public_html/lib/python/Django-1.9.7-py3.8.egg/django/core/management/", line 327, in execute
      File "/home/moskovskaya/public_html/lib/python/Django-1.9.7-py3.8.egg/django/", line 18, in setup
      File "/home/moskovskaya/public_html/lib/python/Django-1.9.7-py3.8.egg/django/apps/", line 108, in populate
      File "/home/moskovskaya/public_html/lib/python/Django-1.9.7-py3.8.egg/django/apps/", line 202, in import_models
        self.models_module = import_module(models_module_name)
      File "/usr/lib/python3.8/importlib/", line 127, in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
      File "", line 1014, in _gcd_import
      File "", line 991, in _find_and_load
      File "", line 975, in _find_and_load_unlocked
      File "", line 671, in _load_unlocked
      File "", line 783, in exec_module
      File "", line 219, in _call_with_frames_removed
      File "/home/moskovskaya/public_html/lib/python/Django-1.9.7-py3.8.egg/django/contrib/auth/", line 4, in 
        from django.contrib.auth.base_user import AbstractBaseUser, BaseUserManager
      File "/home/moskovskaya/public_html/lib/python/Django-1.9.7-py3.8.egg/django/contrib/auth/", line 49, in 
        class AbstractBaseUser(models.Model):
    RuntimeError: __class__ not set defining 'AbstractBaseUser' as . Was __classcell__ propagated to type.__new__?
Ilia's picture
Submitted by Ilia on Tue, 01/19/2021 - 06:04

Okay, there were few bugs. It will be fixed for the next release, meanwhile run:

curl -o /usr/share/webmin/virtual-server/

.. and you would need to update Django install script and make sure that you're installing latest 3.1.5 which actually works:

curl -o /usr/share/webmin/virtual-server/scripts/

Restart Webmin afterwards and enjoy your ride. :--)


I ran into the same problem and after following the above directions I encountered another problem:

public_html/zunzun/lib/python/Django-3.1.7-py3.7.egg/django/db/backends/mysql/", line 27, in DatabaseIntrospection
AttributeError: module 'MySQLdb.constants.FIELD_TYPE' has no attribute 'JSON'
Ilia's picture
Submitted by Ilia on Tue, 02/23/2021 - 02:16

FIELD_TYPE.JSON: 'JSONField', AttributeError: module 'MySQLdb.constants.FIELD_TYPE' has no attribute 'JSON'

It doesn't seem as Virtualmin issue to me.

I won't ask why you're still using Django 1.9 but I noticed that in your posts you have:

"Now installing Django version 1.9.7"



You can't mix and match Django ~ python versions. I recommend using "virtualenv" to compartmentalise your packages.

FWIW you shouldnt be putting your Django app inside "public_html". One bad config and Apache will be returning your whole file directory to the browser.