Intellij / Python / Flask / virtualenv - using the interactive debugger

I installed the Python plugin and created a virtualenv for an existing Flask project. I added a Python SDK with this virtualenv.

Intellij recognized that the dependencies in the requirements.txt were missing so I installed them.

Moreoever, I checked if I have all dependencies in my virtualenv -> OK.

When I try to run a flask instance with the interactive debugger - Intellij does not find certain dependencies - maybe it is missing

to activate the virtualenv even though it is specified in the SDK of the module


FLASK_APP = oqp_backend
FLASK_ENV = development

In folder /Users/pkonrad/workspace/myproject

/Users/pkonrad/workspace/myproject/venv/bin/python "/Users/pkonrad/Library/Application Support/IntelliJIdea2019.3/python/helpers/pydev/" --module --multiproc --qt-support=auto --client --port 59370 --file flask run --port 8000

pydev debugger: process 21088 is connecting

Connected to pydev debugger (build 193.6494.35)
* Serving Flask app "myproject" (lazy loading)
* Environment: development
* Debug mode: on
* Running on (Press CTRL+C to quit)
* Restarting with stat
pydev debugger: process 21092 is connecting


However, - - [06/Mar/2020 18:01:45] "OPTIONS /graphql HTTP/1.1" 500 -
Traceback (most recent call last):
File "/Users/pkonrad/workspace/myproject/backend/", line 8, in <module>
from import create_app
File "/Users/pkonrad/workspace/myproject/myproject/", line 30, in <module>
from oqp_backend.graphql import schema
File "/Users/pkonrad/workspace/myproject/backend/graphql/", line 1, in <module>
import graphene
File "/Users/pkonrad/workspace/myproject/venv/lib/python3.7/site-packages/graphene/", line 3, in <module>
from .types import (
File "/Users/pkonrad/workspace/myproject/venv/lib/python3.7/site-packages/graphene/types/", line 2, in <module>
from graphql import ResolveInfo
ImportError: cannot import name 'ResolveInfo' from 'graphql' (/Users/pkonrad/workspace/myproject/backend/graphql/


In PyCharm all this functionality worked without further configuration and I don't really know what I should do now with Intellij.

Before I checked if graphene was actually installed:

source venv/bin/activate
➜  python
Python 3.7.6 (default, Dec 30 2019, 19:38:28)
[Clang 11.0.0 (clang-1100.0.33.16)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from graphql import ResolveInfo

1 comment
Comment actions Permalink

Does the issue reproduce when you just Run it instead of Debug?
If yes, copy the executed by IDE command (you can see it in the output) and try running it from the system terminal.


Please sign in to leave a comment.