---
title: "Python MySQLdb module"
canonical_url: "https://www.zone.lv/help/kb/python-mysqldb-module/"
post_type: "ht_kb"
published: "2024-04-03T14:18:06+00:00"
modified: "2024-04-23T12:13:27+00:00"
language: "en"
author: "silver"
taxonomies:
  ht_kb_category:
    - name: "Technical"
      url: "https://www.zone.lv/help/kb-categories/technical-en/"
  ht_kb_tag:
    - name: "MySQLdb"
      url: "https://www.zone.lv/help/kb-tags/mysqldb-en/"
    - name: "python"
      url: "https://www.zone.lv/help/kb-tags/python-en/"
---

# Python MySQLdb module

There is no MySQLdb python module in the ZoneOS software platform. This is the source of the error: `No module named MySQLdb.`

The `pymysql` module should be used instead.

`pymysql` module can be installed in a python *virtual environment* as follows:

```
virtualenv --python=python3 ~/.virtualenv/mysql
~/.virtualenv/mysql/bin/pip install pymysql
~/.virtualenv/mysql/bin/python your-script.py
```
