# Error: No module named 'psycopg2.\_psycopg'

**URL:** <https://community.dynatrace.com/t/error-no-module-named-psycopg2-psycopg/37156>\
**Category:** Extensions\
**Tags:** extensions\
**Created:** [November 4, 2022, 5:48pm UTC](https://community.dynatrace.com/t/error-no-module-named-psycopg2-psycopg/37156 "2022-11-04T17:48:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rbeguin](https://avatars.discourse-cdn.com/v4/letter/r/4491bb/32.png) [@rbeguin](https://community.dynatrace.com/u/rbeguin)\
**Post date:** [November 4, 2022, 5:48pm UTC](https://community.dynatrace.com/t/error-no-module-named-psycopg2-psycopg/37156/1 "2022-11-04T17:48:22Z")

</div>

Hello,

Anyone can help me solving this error please&nbsp;:

 ![rbeguin_0-1667583207806.png](https://global.discourse-cdn.com/dynatrace/original/3X/d/7/d7bcae2a113c948f35525cc34ba5cc425321a1b5.png)

Here is Python import in my .py file :

import psycopg2Here is install requirement in plugin.json :

 ![rbeguin_1-1667583399679.png](https://global.discourse-cdn.com/dynatrace/original/2X/4/45ad3b13c7e9232c923f9a373c02c2acf912f7ca.png)

I launched this command to build extension :  
_plugin\_sdk build\_plugin -t \<my\_token\>_

I tryed many things :

1) building extension directly in production host with this command (it build but doesnt’n work when launching)

2)&nbsp;building extension in my dev personnal computer with this command (it build but doesnt’n work when uploading and launching on production host but work well in my personnal computer where activegate is launched)

Here is error in logs :

 ![rbeguin_2-1667583893424.png](https://global.discourse-cdn.com/dynatrace/original/2X/4/4d1b3cb26bc0338211bc5e27fa7acb640793e03a.png)

I don’t understand because psycopg2.\_psycopg exists :

![rbeguin_3-1667584000040.png](https://global.discourse-cdn.com/dynatrace/optimized/3X/2/9/29242fea8e9b8919445b992f0bc751fb9373b8ce_2_690x21.png)

thanks

---

<div class="post-metadata">

**Author:** ![david\_lopes](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/david_lopes/32/27273_2.png) [@david\_lopes](https://community.dynatrace.com/u/david_lopes)\
**Post date:** [November 29, 2022, 12:12pm UTC](https://community.dynatrace.com/t/error-no-module-named-psycopg2-psycopg/37156/2 "2022-11-29T12:12:31Z")

</div>

You need to use python 3.8 to build your extension, because that is the python version that is bundled with the Activegate and OneAgent.
