0

Showing this error while executing Pandas Profiling on pycharm or windows terminal

Pycharm latest
Python version 3.6 Windows 7 Pandas profiling 1.4

pandas_profiling.ProfileReport(df) :

RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phase.

This probably means that you are not using fork to start your
child processes and you have forgotten to use the proper idiom
in the main module:

    if __name__ == '__main__':
        freeze_support()
        ...

The "freeze_support()" line can be omitted if the program
is not going to be frozen to produce an executable.
Simon
  • 5,464
  • 6
  • 49
  • 85
DeshDeep Singh
  • 1,817
  • 2
  • 23
  • 43

1 Answers1

0

So the solution for the problem is as simple as the one below:

Added a main to my code and then in the end called if name statement to run. This solves my problem in quick easy steps.

import pandas as pd
import pandas_profiling
def main():
# my code for profiling
    df = pd.read_csv('csvfile')
    profile = pandas_profiling.ProfileReport(df)
    profile.to_file("profile.html")

if __name__ == "__main__": main()
DeshDeep Singh
  • 1,817
  • 2
  • 23
  • 43