0

I try to run py script via Task Scheduler at server. However, despite setting a Task and Trigger for it, my script is not running. I even tried to run it manually via cmd console, only with bellow result in error message:

Traceback (most recent call last):
  File "D:\EAR_script\EAR_script", line 9, in <module>
    import psycopg2
  File "D:\EAR_script\.venv\lib\site-packages\psycopg2\__init__.py", line 51, in <module>
    from psycopg2._psycopg import (                     # noqa
ModuleNotFoundError: No module named 'psycopg2._psycopg'

all of the module listed in error message are in Lib folder. Any clue how to solve it?

  • pip install psycopg2 – Ahmad Anis Mar 09 '23 at 07:59
  • According to [this question](https://stackoverflow.com/questions/32146886/cant-install-psycopg-on-windows-7-with-python-3-4-3-and-postgresql-9-4-4) there are versions for 64bit and 32bit. Maybe you have the wrong version in your Lib folder. – white Mar 09 '23 at 08:19
  • `ERROR: Could not find a version that satisfies the requirement psycopg2 (from versions: none) ERROR: No matching distribution found for psycopg2` –  Mar 09 '23 at 08:20
  • @white I checked it and my python run at 64bit, version 3.10.4 –  Mar 09 '23 at 08:29

0 Answers0