# Error in python script for mappdatabaseconnector - pkg\_resources is missing

**URL:** <https://community.br-automation.com/t/error-in-python-script-for-mappdatabaseconnector-pkg-resources-is-missing/5975>\
**Category:** HMI & Visualization\
**Tags:** mapp-services\
**Created:** [February 21, 2025, 9:05am UTC](https://community.br-automation.com/t/error-in-python-script-for-mappdatabaseconnector-pkg-resources-is-missing/5975 "2025-02-21T09:05:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![surajpatil26796](https://avatars.discourse-cdn.com/v4/letter/s/FF8800/32.png) [@surajpatil26796](https://community.br-automation.com/u/surajpatil26796)\
**Post date:** [February 21, 2025, 9:05am UTC](https://community.br-automation.com/t/error-in-python-script-for-mappdatabaseconnector-pkg-resources-is-missing/5975/1 "2025-02-21T09:05:03Z")

</div>

Hello Experts,  
I am testing MappServices(5.24.3) \> mpdatabasecore functionality in AS 4.12.  
I have below installations:  
MySql 8.0.14  
Python 3.13.1  
Mysql-connecotor - 9.2.0  
Script: MappDatabaseConnector - 5.12.0

I am getting below error in Python script during testing:

 ![image](https://europe1.discourse-cdn.com/brcommunity/original/2X/9/9c0297ecbf8b91edea5dcc48911102afa1e6fae9.png)

 ![image](https://europe1.discourse-cdn.com/brcommunity/original/2X/0/075da08cb5ab1d76b363c99358e1eeee64524399.png)

Is there something i am missing ?

---

<div class="post-metadata">

**Author:** ![michael.stockhammer](https://dub1.discourse-cdn.com/brcommunity/user_avatar/community.br-automation.com/michael.stockhammer/32/231_2.png) [@michael.stockhammer](https://community.br-automation.com/u/michael.stockhammer)\
**Post date:** [February 21, 2025, 9:38am UTC](https://community.br-automation.com/t/error-in-python-script-for-mappdatabaseconnector-pkg-resources-is-missing/5975/2 "2025-02-21T09:38:42Z")

</div>

Hi!

The main issue here seems to be that the python installation is missing the `pkg_resources`. You should be able to install these using `pip install setuptools` ([PyPi](https://pypi.org/project/setuptools/)).  
That should resolve your connection issues (or at least this specific problem/exception).

Please note that the first exception in this case is kind of misleading… That one happens **as part of** the connection process (in other words the `KeyError` exception is happening when you try to connect and is “kind-of” expected).

Please let us know if installing the `setuptools` solved your problem!

---

<div class="post-metadata">

**Author:** ![surajpatil26796](https://avatars.discourse-cdn.com/v4/letter/s/FF8800/32.png) [@surajpatil26796](https://community.br-automation.com/u/surajpatil26796)\
**Post date:** [February 21, 2025, 9:51am UTC](https://community.br-automation.com/t/error-in-python-script-for-mappdatabaseconnector-pkg-resources-is-missing/5975/3 "2025-02-21T09:51:09Z")

</div>

Thanks @michael.stockhammer for the suggestion. I am now able to connect to the database. But there is one deprecation warning as shown below.

 ![image](https://europe1.discourse-cdn.com/brcommunity/original/2X/a/a0b80094f3454ac4d970a70407699ee547331713.png)

---

<div class="post-metadata">

**Author:** ![michael.stockhammer](https://dub1.discourse-cdn.com/brcommunity/user_avatar/community.br-automation.com/michael.stockhammer/32/231_2.png) [@michael.stockhammer](https://community.br-automation.com/u/michael.stockhammer)\
**Post date:** [February 21, 2025, 10:04am UTC](https://community.br-automation.com/t/error-in-python-script-for-mappdatabaseconnector-pkg-resources-is-missing/5975/4 "2025-02-21T10:04:54Z")

</div>

Unfortunately there is no updated script available (yet), but you should be able to ignore this warning (I cannot find any information that this library will be deleted anytime soon).

Either way, this warning does not influence the behaviour of the script (or MpDatabase) as long as this package is available for download. It pretty much just states that there would be “more modern” packages doing the same tasks…

**PS:** I do agree that seeing a warning is not nice (and should be fixed) 😉

---

<div class="post-metadata">

**Author:** ![surajpatil26796](https://avatars.discourse-cdn.com/v4/letter/s/FF8800/32.png) [@surajpatil26796](https://community.br-automation.com/u/surajpatil26796)\
**Post date:** [February 21, 2025, 10:15am UTC](https://community.br-automation.com/t/error-in-python-script-for-mappdatabaseconnector-pkg-resources-is-missing/5975/5 "2025-02-21T10:15:20Z")

</div>

Thanks for your time! No issue.
