Python debugging error: Fatal Python error: init_import_size: Failed to import the site module

Configuration works for run, but fails for Debug, with this console output

```

/Users/me/Projects/x/venv/bin/python3.8 /Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/pydevd.py --multiproc --qt-support=auto --client 127.0.0.1 --port 53236 --file /Users/me/Projects/x/venv/bin/newrelic-admin run-program gunicorn --bind=0.0.0.0:8080 --worker-class=gevent --worker-connections 1000 --keep-alive=60 --timeout=30 --reload --graceful-timeout=30 --reuse-port wsgi:app --access-logfile -
Connected to pydev debugger (build 211.7628.24)
Fatal Python error: init_import_size: Failed to import the site module
Python runtime state: initialized
Traceback (most recent call last):
File "/usr/local/opt/python@3.8/bin/../Frameworks/Python.framework/Versions/3.8/lib/python3.8/site.py", line 580, in <module>
main()
File "/usr/local/opt/python@3.8/bin/../Frameworks/Python.framework/Versions/3.8/lib/python3.8/site.py", line 567, in main
known_paths = addsitepackages(known_paths)
File "/usr/local/opt/python@3.8/bin/../Frameworks/Python.framework/Versions/3.8/lib/python3.8/site.py", line 350, in addsitepackages
addsitedir(sitedir, known_paths)
File "/usr/local/opt/python@3.8/bin/../Frameworks/Python.framework/Versions/3.8/lib/python3.8/site.py", line 208, in addsitedir
addpackage(sitedir, name, known_paths)
File "/usr/local/opt/python@3.8/bin/../Frameworks/Python.framework/Versions/3.8/lib/python3.8/site.py", line 169, in addpackage
exec(line)
File "<string>", line 1, in <module>
File "<frozen importlib._bootstrap_external>", line 1342, in find_spec
File "<frozen importlib._bootstrap_external>", line 1330, in _get_spec
KeyboardInterrupt

Process finished with exit code 1
```
packages are up to date. 

I'm not really sure what to check next

2 comments
Comment actions Permalink

Hi, please check if you have "gevent compatible" enabled in Preferences | Build, Execution, Deployment | Python Debugger, try both states (enabled/disabled) - does it help? 

If not, please submit an issue to https://youtrack.jetbrains.com with additional information:

1. What type of project this is (Flask?)

2. Minimal project to reproduce the issue if possible

3. Screenshot of your run/debug configuration settings

4. Logs from **Help | Collect Logs and Diagnostic Data**

0

Please sign in to leave a comment.