E
E
Eugene2020-08-05 17:22:14
Python
Eugene, 2020-08-05 17:22:14

What is the problem when importing psycopg?

Good afternoon.
I am developing a flask application (1.1.2). ORM - flask-sqlalchemy (2.4.4)
Installed psycopg2 (2.8.5)
python (3.8.2)
When importing it, a similar stacktrace occurs:

Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "C:\Program Files\JetBrains\PyCharm 2019.2.4\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "C:\Users\f\Documents\PythonProjects\project_name\venv\lib\site-packages\psycopg2\__init__.py", line 51, in <module>
    from psycopg2._psycopg import (                     # noqa
  File "C:\Program Files\JetBrains\PyCharm 2019.2.4\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import


With the same input, another application works without problems with psycopg2. Versions match one to one. Could it be a project configuration issue? Maybe in a virtual environment?

Thanks in advance for your reply.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nick, 2020-08-05
@c00re

If everything is ok in another application, then there are problems with PyCharm. Try reinstalling it

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question