Pycharm is slow at importing during debugging - what can I do apart from Attach to subprocess automatically while debugging?
After installing Pycharm 2018.3.2, I realize that during debugging the import of other packages is getting really slow.
Taking the imports below resulted (with Pycharms default settings) to a runtime of 10 seconds.
It seems to be related to the setting
Attach to subprocess automatically while debugging (see:
File | Settings | Build, Execution, Deployment | Python Debugger). When I disable this, the debugging gets (much) faster:
/home/user/anaconda3/bin/python3 /home/user/4me/Technologie/0010-install/0220-pycharm-installation/2018-3/pycharm-2018.3/helpers/pydev/pydevd.py --cmd-line --client 127.0.0.1 --port 38085 --file /home/user/PycharmProjects/0540_sqlalchemy_and_pooling/attic.py pydev debugger: starting Connected to pydev debugger (build 183.4886.43) pydev debugger: New process is launching (breakpoints won't work in the new process). pydev debugger: To debug that process please enable 'Attach to subprocess automatically while debugging?' option in the debugger settings. time used ----: 2.4612913131713867 fin Process finished with exit code 1
I opened already a bug at Pycharm ( https://youtrack.jetbrains.com/issue/PY-33464 ) for this.
Why is this so that this flag makes debugging much faster and are there other workarounds available, too?
import time my_time = time.time() from sklearn import datasets, linear_model from sklearn.metrics import mean_squared_error, r2_score import numba as nb import time import sys import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot as plt from matplotlib.ticker import FuncFormatter import numpy as np import pandas as pd import datetime from typing import Dict, List, Optional import datetime import pickle from os import listdir import os from os.path import isfile, join import logging import re import traceback from dateutil.easter import * import copy import multiprocessing from multiprocessing import Pool from multiprocessing import cpu_count from fbprophet import Prophet print("time used ----:", time.time() - my_time) print("fin") import sys sys.exit(1)