Django install script fails with "No module named 'django'"

|SYSTEM INFORMATION||

System hostname delegate.network (127.0.0.1) Operating system Debian Linux 11
Webmin version 1.981 Usermin version 1.823
Virtualmin version 6.17-3 Pro Authentic theme version 19.83-2
Time on system Wednesday, November 17, 2021 4:31 AM Kernel and CPU Linux 5.10.0-9-amd64 on x86_64
Processor information AMD EPYC 7501 32-Core Processor, 2 cores System uptime 28 days, 10 hours, 36 minutes


 Install Script
In domain delegate.network
Downloading http://www.djangoproject.com/download/3.2.9/tarball/ ..
Downloading https://media.djangoproject.com/releases/3.2/Django-3.2.9.tar.gz (9.35 MiB) ..
     Received 1 KiB (0 %)
     Received 958 KiB (10 %)
     Received 1.87 MiB (20 %)
     Received 2.8 MiB (30 %)
     Received 3.74 MiB (40 %)
     Received 4.67 MiB (50 %)
     Received 5.61 MiB (60 %)
     Received 6.54 MiB (70 %)
     Received 7.48 MiB (80 %)
     Received 8.41 MiB (90 %)
     Received 9.35 MiB (100 %)
.. download complete.
Downloading http://www.saddi.com/software/flup/dist/flup-1.0.2.tar.gz (266 bytes) ..
Downloading https://www.saddi.com/software/flup/dist/flup-1.0.2.tar.gz (47.9 KiB) ..
     Received 7.69 KiB (16 %)
     Received 9.69 KiB (20 %)
     Received 14.69 KiB (30 %)
     Received 19.69 KiB (41 %)
     Received 24.69 KiB (51 %)
     Received 29.69 KiB (62 %)
     Received 33.69 KiB (70 %)
     Received 38.69 KiB (80 %)
     Received 43.69 KiB (91 %)
     Received 47.9 KiB (100 %)
.. download complete.

Python module MySQLdb is required ..
Installing package python3-mysqldb ..
Installing package(s) with command apt-get -y -f install python3-mysqldb ..
Reading package lists...
Building dependency tree...
Reading state information...
The following packages were automatically installed and are no longer required:
  awstats bsdmainutils certbot clamav clamav-base clamav-daemon clamav-docs
  clamav-freshclam clamav-testfiles clamdscan cpp-8 fonts-lato geoip-database
  jailkit libapache2-mod-fcgid libasan5 libauthen-oath-perl libberkeleydb-perl
  libbind9-161 libclamav9 libcodec2-0.8.1 libcommon-sense-perl libcroco3
  libcrypt-openssl-bignum-perl libcrypt-openssl-random-perl
  libcrypt-openssl-rsa-perl libcrystalhd3 libdigest-bubblebabble-perl
  libdns1104 libdns1110 libevent-2.1-6 libexporter-tiny-perl libfcgi-dev
  libgeoip1 libhavege1 libhiredis0.14 libicu63 libigdgmm5 libimport-into-perl
  libio-multiplex-perl libipset11 libirs161 libisc1100 libisc1105 libisccc161
  libisccfg163 libisl19 libjson-perl libjson-xs-perl libjsoncpp1 libllvm7
  liblua5.2-0 liblwres161 libmail-authenticationresults-perl libmail-dkim-perl
  libmail-spf-perl libmemcached11 libmemcachedutil2 libmilter1.0.1 libmoo-perl
  libmpdec2 libmpx2 libmspack0 libnet-cidr-perl libnet-dns-perl
  libnet-dns-sec-perl libnet-ip-perl libnet-rblclient-perl libnet-server-perl
  libnet-xwhois-perl libnetaddr-ip-perl libnftables0 libnl-3-200
  libnl-genl-3-200 libopendkim11 libparse-syslog-perl libperl4-corelibs-perl
  libperl5.28 libpython2-stdlib libpython2.7 libpython2.7-minimal
  libpython2.7-stdlib libpython3.7 libpython3.7-minimal libpython3.7-stdlib
  libre2-5 libreadline5 libreadline7 libruby2.5 libruby2.7 libspf2-2
  libstrictures-perl libtfm1 libtype-tiny-perl libtype-tiny-xs-perl
  libtypes-serialiser-perl libusbmuxd4 libvpx5 libx264-155 libx265-165
  linux-image-4.19.0-17-amd64 mariadb-client mariadb-server milter-greylist
  ntpdate p7zip perl-modules-5.28 php-cgi php-fpm php-mbstring php-mysql
  postgrey procmail-wrapper proftpd-basic proftpd-core proftpd-doc
  proftpd-mod-crypto proftpd-mod-wrap python2 python2-minimal python2.7
  python2.7-minimal python3-acme python3-asn1crypto python3-certbot
  python3-configargparse python3-distro python3-future python3-icu
  python3-josepy python3-mock python3-parsedatetime python3-pbr
  python3-requests-toolbelt python3-rfc3339 python3-tz python3-zope.component
  python3-zope.event python3-zope.hookable python3-zope.interface
  python3.7-minimal quota rake re2c ri ruby ruby-did-you-mean ruby-minitest
  ruby-net-telnet ruby-power-assert ruby-rubygems ruby-test-unit ruby-xmlrpc
  ruby2.5-doc ruby2.7 ruby2.7-doc rubygems-integration sa-compile spamassassin
  spamc webalizer
Use 'apt autoremove' to remove them.
Suggested packages:
  python3-mysqldb-dbg
The following NEW packages will be installed:
  python3-mysqldb
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 57.0 kB of archives.
After this operation, 183 kB of additional disk space will be used.
Get:1 http://mirrors.linode.com/debian bullseye/main amd64 python3-mysqldb amd64 1.4.4-2+b3 [57.0 kB]
Fetched 57.0 kB in 0s (3929 kB/s)
Selecting previously unselected package python3-mysqldb.
(Reading database ... 
(Reading database ... 5%
(Reading database ... 10%
(Reading database ... 15%
(Reading database ... 20%
(Reading database ... 25%
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 201769 files and directories currently installed.)
Preparing to unpack .../python3-mysqldb_1.4.4-2+b3_amd64.deb ...
Unpacking python3-mysqldb (1.4.4-2+b3) ...
Setting up python3-mysqldb (1.4.4-2+b3) ...
.. install complete.
.. done
Now installing Django version 3.2.9 ..
DB initialization install failed :
Traceback (most recent call last):
  File "/home/delegate/public_html/delegatenetwork/manage.py", line 11, in main
    from django.core.management import execute_from_command_line
ModuleNotFoundError: No module named 'django'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/delegate/public_html/delegatenetwork/manage.py", line 22, in <module>
    main()
  File "/home/delegate/public_html/delegatenetwork/manage.py", line 13, in main
    raise ImportError(
ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?
More information on using this script can be found at http://www.djangoproject.com/.

.. installation was only partially complete.
Re-loading Webmin ..
.. done

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.